From 553dd46a48ca8d18eb6b4b030cace451394168f8 Mon Sep 17 00:00:00 2001 From: esteinig Date: Wed, 1 Nov 2023 13:13:15 +1100 Subject: [PATCH] chore(gitflow): build release yml --- .../{build_release.yml => build.yml} | 8 ++-- .github/workflows/release.yml | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) rename .github/workflows/{build_release.yml => build.yml} (95%) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build_release.yml b/.github/workflows/build.yml similarity index 95% rename from .github/workflows/build_release.yml rename to .github/workflows/build.yml index 214810bd..d346ab85 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ # release ci: build linux binaries and attach to release with SHA256 -name: build and release +name: build on: workflow_dispatch: - release: - types: [ created ] + release: + types: [ published ] permissions: contents: write @@ -44,7 +44,7 @@ jobs: if: matrix.platform.os_name != 'Windows-x86_64' - name: Generate SHA-256 of uncompressed binary run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256 - - name: Compress binary and package files + - name: Compress binary run: tar -cJf target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.tar.xz target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} - name: Release binary and SHA-256 checksum to GitHub uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..db63f346 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +on: + workflow_dispatch: + branches: main + +jobs: + cog_check_job: + runs-on: ubuntu-latest + name: check conventional commit compliance + steps: + - uses: actions/checkout@main + with: + fetch-depth: 0 + + release: + name: Perform release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Conventional commits check + uses: oknozor/cocogitto-action@v3 + with: + check-latest-tag-only: true + + - name: Cocogitto release + id: release + uses: oknozor/cocogitto-action@v3 + with: + release: true + git-user: ${{ secrets.GITHUB_USERNAME }} + git-user-email: ${{ secrets.GITHUB_EMAIL }} + + - name: Generate Changelog + run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md + + - name: Upload github release + uses: softprops/action-gh-release@v1 + with: + body_path: GITHUB_CHANGELOG.md + tag_name: ${{ steps.release.outputs.version }} + token: ${{ secrets.GITHUB_TOKEN }}