-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get the publish and release workflows working.
Misc. changes to CI caught during further testing: - Use different names for shell vars TAG and IMAGE_TAG - `TAG` and `IMAGE_TAG` are two different things. - Stop using make/dapper: env vars get lost - Need to hardwire the artifacts name - Push max k8s version back to 1.28 - Need to create a the temp dir before jumping into it. - Try running on a self-hosted VM
- Loading branch information
1 parent
6346acf
commit 1f1ba5b
Showing
17 changed files
with
228 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,81 @@ | ||
name: goreleaser | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
ci: | ||
uses: rancher/webhook/.github/workflows/ci.yaml@release/v0.5 | ||
permissions: | ||
contents: read | ||
goreleaser: | ||
needs: [ | ||
ci | ||
] | ||
build: | ||
name: build and package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: | ||
- amd64 | ||
- arm64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-tags: true | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
- name: Package release helm charts | ||
run: make package-helm | ||
- run: mkdir -p ./build/artifacts/ && mv -v ./dist/artifacts/ ./build/ | ||
- uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name : Checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
# https://github.com/actions/checkout/releases/tag/v4.1.1 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
# https://github.com/actions/setup-go/releases/tag/v5.0.0 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Build and package | ||
run: ./scripts/build && ./scripts/package && ./scripts/package-helm | ||
env: | ||
ARCH: "${{ matrix.arch}}" | ||
|
||
- name: Get the version | ||
run: | | ||
source ./scripts/version | ||
echo "VERSION=$VERSION" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Generate checksum files | ||
run: | | ||
ls -lR dist | ||
cd dist/artifacts | ||
sha256sum webhook-linux-${{ matrix.arch}} > sha256sum-${{ matrix.arch}}.txt | ||
- name: Upload artifacts | ||
# https://github.com/actions/upload-artifact/commit/65462800fd760344b1a7b4382951275a0abb4808 | ||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 | ||
with: | ||
name: webhook-artifacts-${{ matrix.arch}} | ||
path: | | ||
dist/artifacts/webhook-linux-${{ matrix.arch}} | ||
dist/artifacts/sha256sum-${{ matrix.arch}}.txt | ||
dist/artifacts/rancher-webhook-*.tgz | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download the amd64 artifacts | ||
# https://github.com/actions/download-artifact/commit/65a9edc5881444af0b9093a5e628f2fe47ea3b2e | ||
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e | ||
with: | ||
name: webhook-artifacts-amd64 | ||
path: dist/artifacts | ||
- name: Download the arm64 artifacts | ||
# https://github.com/actions/download-artifact/commit/65a9edc5881444af0b9093a5e628f2fe47ea3b2e | ||
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e | ||
with: | ||
name: webhook-artifacts-arm64 | ||
path: dist/artifacts | ||
- name: Upload the files | ||
run: | | ||
ls -lR dist | ||
cd dist/artifacts | ||
gh release upload $VERSION webhook-linux-* sha256sum-*.txt rancher-webhook*.tgz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
set -eu | ||
|
||
REPO_URL=https://github.com/rancher/k3d | ||
K3D_URL=https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | ||
DEFAULT_K3D_VERSION=v5.4.6 | ||
|
||
install_k3d(){ | ||
local k3dVersion=${K3D_VERSION:-${DEFAULT_K3D_VERSION}} | ||
echo -e "Downloading k3d@${k3dVersion} see: ${K3D_URL}" | ||
curl --silent --fail ${K3D_URL} | TAG=${k3dVersion} bash | ||
if [ -z "${K3D_VERSION:-}" -o "${K3D_VERSION:-}" = "latest" ] ; then | ||
K3D_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} "${REPO_URL}/releases/latest" | grep -oE "[^/]+$") | ||
fi | ||
echo -e "Downloading k3d@${K3D_VERSION} from ${K3D_URL}" | ||
curl --silent --fail ${K3D_URL} | TAG=${K3D_VERSION} bash | ||
} | ||
|
||
install_k3d | ||
|
||
k3d version | ||
k3d version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.