From 27947218e72afcef7a554866a21b3a21f0b4a526 Mon Sep 17 00:00:00 2001 From: Nicolas Carlier Date: Tue, 3 Oct 2023 20:54:47 +0000 Subject: [PATCH] chore(ci): review build steps --- .github/workflows/build.yml | 20 +++++++++++++++----- .github/workflows/docker.yml | 4 ++-- .github/workflows/release.yml | 27 --------------------------- 3 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ddb995..f39c053 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: Build on: push: branches: [ master ] - tags: [ 'v*' ] pull_request: branches: [ master ] @@ -14,23 +13,34 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive - - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.21 - - name: Test run: make build test + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Conventional CHANGELOG + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + if: github.ref == 'refs/heads/master' + with: + github-token: ${{ secrets.github_token }} - name: Distribution run: make distribution - if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/master' && steps.changelog.outputs.skipped == 'false' - name: Release uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/master' && steps.changelog.outputs.skipped == 'false' with: + body: ${{ steps.changelog.outputs.clean_changelog }} + tag_name: ${{ steps.changelog.outputs.tag }} + name: ${{ steps.changelog.outputs.tag }} files: | release/webhookd-linux-amd64.tgz release/webhookd-linux-arm64.tgz diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 90b7c95..5f276da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,11 +1,11 @@ name: Publish Docker image on: + release: + types: [published] push: branches: - 'master' - tags: - - 'v*' jobs: push_to_registry: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 59a1492..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Releases -on: - push: - branches: - - master - -jobs: - changelog: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: conventional Changelog Action - id: changelog - uses: TriPSs/conventional-changelog-action@v3 - with: - github-token: ${{ secrets.github_token }} - - - name: create release - uses: actions/create-release@v1 - if: ${{ steps.changelog.outputs.skipped == 'false' }} - env: - GITHUB_TOKEN: ${{ secrets.github_token }} - with: - tag_name: ${{ steps.changelog.outputs.tag }} - release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} \ No newline at end of file