Skip to content

Commit

Permalink
ci: simplify release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rogosprojects committed Aug 12, 2024
1 parent eee1be3 commit 49530cf
Showing 1 changed file with 29 additions and 37 deletions.
66 changes: 29 additions & 37 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
prepare-release:
name: Prepare release

update-changelog:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: "Checkout"
- name: GitHub Create Tag Release
uses: Roang-zero1/github-create-release-action@v3
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: requarks/changelog-action@v1
name: "Update CHANGELOG"
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
- uses: softprops/action-gh-release@v2
name: "Add changes to release notes"
with:
body: ${{ steps.changelog.outputs.changes }}
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md

releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
Expand All @@ -30,15 +41,16 @@ jobs:
- goarch: "386"
goos: darwin
steps:
- name: Get Release Info
- name: "Get Release Info"
run: |
echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
echo "PACKAGE_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "OS_NAME=${{ matrix.goos }}" >> $GITHUB_ENV
- name: OS darwin
if: matrix.goos == 'darwin'
run: echo "OS_NAME=macOS" >> $GITHUB_ENV
if [ "${{ matrix.goos }}" == "darwin" ]; then
echo "OS_NAME=macOS" >> $GITHUB_ENV
else
echo "OS_NAME=${{ matrix.goos }}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- uses: wangyoucao577/[email protected]
with:
Expand All @@ -51,25 +63,5 @@ jobs:
executable_compression: upx -v
md5sum: false
ldflags: '-X github.com/${{ env.PACKAGE_NAME }}/cmd.BuildVersion=${{ env.RELEASE_TAG }}'
update-changelog:
name: Update release notes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: "Checkout"
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Add changes to release notes
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.changes }}
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md


0 comments on commit 49530cf

Please sign in to comment.