From 636191d88639b5948a1f756cff48479df4771d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fynn=20Sp=C3=A4ker?= Date: Wed, 26 Oct 2022 09:53:29 +0200 Subject: [PATCH] Refine release workflow (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fynn Späker --- .../{on-push-test.yml => on-pr-test.yml} | 3 - .github/workflows/on-push-pre-release.yml | 65 ------------------- .github/workflows/on-release-publish.yml | 30 +++++++-- 3 files changed, 26 insertions(+), 72 deletions(-) rename .github/workflows/{on-push-test.yml => on-pr-test.yml} (87%) delete mode 100644 .github/workflows/on-push-pre-release.yml diff --git a/.github/workflows/on-push-test.yml b/.github/workflows/on-pr-test.yml similarity index 87% rename from .github/workflows/on-push-test.yml rename to .github/workflows/on-pr-test.yml index fd11be6b0..284007951 100644 --- a/.github/workflows/on-push-test.yml +++ b/.github/workflows/on-pr-test.yml @@ -3,9 +3,6 @@ name: go:test on: pull_request: paths-ignore: 'docs/**' - push: - branches-ignore: '*/*' - paths-ignore: 'docs/**' jobs: test: diff --git a/.github/workflows/on-push-pre-release.yml b/.github/workflows/on-push-pre-release.yml deleted file mode 100644 index 9ceb62ba1..000000000 --- a/.github/workflows/on-push-pre-release.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: go:pre-release - -on: - push: - tags: 'v*' - -jobs: - create-pre-release: - runs-on: ubuntu-latest - - steps: - - name: Checkout commit - uses: actions/checkout@v2 - - name: Update VERSION file - run: |- - echo "${{ github.ref_name }}" > VERSION - - name: Create controller-registration.yaml - run: |- - vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh provider-hcloud charts/gardener-extension-provider-hcloud ${{ github.ref_name }} controller-registration.yaml \ - ControlPlane:hcloud Infrastructure:hcloud Worker:hcloud - vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh provider-hcloud charts/gardener-extension-provider-hcloud ${{ github.ref_name }}-rc.${{ github.sha }} rc-controller-registration.yaml \ - ControlPlane:hcloud Infrastructure:hcloud Worker:hcloud - - name: Create Release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref_name }} - body: |- - # [gardener-extension-provider-hcloud] ${{ github.ref_name }} - prerelease: true - files: |- - controller-registration.yaml - rc-controller-registration.yaml - go-pre-publish: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - name: gardener-extension-provider-hcloud - - name: gardener-extension-admission-hcloud - tagSuffix: /admission - - steps: - - name: Checkout commit - uses: actions/checkout@v2 - - name: Update VERSION file - run: |- - echo "${{ github.ref_name }}-rc.${{ github.sha }}" > VERSION - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Publish image - uses: docker/build-push-action@v2 - with: - context: ${{ matrix.context }} - target: ${{ matrix.name }} - push: true - tags: | - ghcr.io/${{ github.repository }}${{ matrix.tagSuffix }}:${{ github.ref_name }}-rc.${{ github.sha }} diff --git a/.github/workflows/on-release-publish.yml b/.github/workflows/on-release-publish.yml index 731a53c7d..ae4ad79b9 100644 --- a/.github/workflows/on-release-publish.yml +++ b/.github/workflows/on-release-publish.yml @@ -1,11 +1,33 @@ -name: go:publish +name: go:release on: - release: - types: [ released ] - workflow_dispatch: + push: + tags: 'v*' jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout commit + uses: actions/checkout@v2 + - name: Update VERSION file + run: |- + echo "${{ github.ref_name }}" > VERSION + - name: Create controller-registration.yaml + run: |- + vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh provider-hcloud charts/gardener-extension-provider-hcloud ${{ github.ref_name }} controller-registration.yaml \ + ControlPlane:hcloud Infrastructure:hcloud Worker:hcloud + - name: Create Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + body: |- + # [gardener-extension-provider-hcloud] ${{ github.ref_name }} + files: |- + controller-registration.yaml go-publish: runs-on: ubuntu-latest strategy: