From 8b2aa2a29043bb34a98358c6efcdc7a02fb7565a Mon Sep 17 00:00:00 2001 From: rakuja Date: Thu, 30 May 2024 22:05:38 +0200 Subject: [PATCH] chore: update actions --- .github/workflows/push_on_main.yml | 36 --------------------------- .github/workflows/release.yml | 40 ++++++++++-------------------- 2 files changed, 13 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/push_on_main.yml diff --git a/.github/workflows/push_on_main.yml b/.github/workflows/push_on_main.yml deleted file mode 100644 index 41b3020..0000000 --- a/.github/workflows/push_on_main.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Push on main -on: - push: - branches: - - 'master' - -env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - -jobs: - changelog: - name: Generate changelog - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate a changelog - uses: orhun/git-cliff-action@v3 - with: - config: cliff.toml - args: --verbose - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9e19f8..4bca111 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }}