From 0ef0a8f274f90e20a338abef8a1d0c345769ddbc Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 9 Jun 2021 12:00:27 +0200 Subject: [PATCH 1/2] Add nightly builds workflow and allow RC releases Changes to CI: - Add nightly builds workflow - Allow publishing release candidate images Signed-off-by: Hidde Beydals --- .github/workflows/nightly.yaml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 10 +++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nightly.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 000000000..0d60165a2 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,33 @@ +name: nightly +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +env: + REPOSITORY: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: all + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + buildkitd-flags: "--debug" + - name: Build multi-arch container image + uses: docker/build-push-action@v2 + with: + push: false + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm/v7,linux/arm64 + tags: | + ${{ env.REPOSITORY }}:nightly diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4b061850..9204fa830 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,12 @@ on: push: tags: - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'image tag prefix' + default: 'rc' + required: true env: CONTROLLER: ${{ github.event.repository.name }} @@ -17,7 +23,7 @@ jobs: - name: Prepare id: prep run: | - VERSION=sha-${GITHUB_SHA::8} + VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}" if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF/refs\/tags\//} fi @@ -68,11 +74,13 @@ jobs: docker pull docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }} docker pull ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }} - name: Generate release manifests + if: startsWith(github.ref, 'refs/tags/v') run: | mkdir -p config/release kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml - name: Create release + if: startsWith(github.ref, 'refs/tags/v') uses: ncipollo/release-action@v1 with: prerelease: true From 418fffab06a6ac8c1910040d6a9cf2c9c33727f1 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 9 Jun 2021 12:30:38 +0200 Subject: [PATCH 2/2] Update kind version in e2e workflow to v0.11.1 Signed-off-by: Hidde Beydals --- .github/workflows/e2e.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 7bc39f341..5263bbfd4 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -26,6 +26,8 @@ jobs: go-version: 1.15.x - name: Setup Kubernetes uses: engineerd/setup-kind@v0.5.0 + with: + version: "v0.11.1" - name: Setup Helm uses: fluxcd/pkg/actions/helm@main - name: Setup Kustomize