Skip to content

Commit

Permalink
chore: update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RakuJa committed May 30, 2024
1 parent 51e3806 commit 8b2aa2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 63 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/push_on_main.yml

This file was deleted.

40 changes: 13 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
on: [release]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -13,33 +14,18 @@ jobs:

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
args: --verbose
env:
OUTPUT: CHANGES.md
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

# use release body in the same job
- name: Upload the binary releases
uses: svenstaro/upload-release-action@v2
with:
file: binary_release.zip
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
body: ${{ steps.git-cliff.outputs.content }}

# use release body in another job
upload:
name: Upload the release
needs: changelog
runs-on: ubuntu-latest
steps:
- name: Upload the binary releases
uses: svenstaro/upload-release-action@v2
with:
file: binary_release.zip
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
body: ${{ needs.changelog.outputs.release_body }}
- name: Commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit --no-verify -m "Update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${{ env.BRANCH_NAME }}

0 comments on commit 8b2aa2a

Please sign in to comment.