Skip to content

Commit

Permalink
Add release workflow to release-bot
Browse files Browse the repository at this point in the history
This commit adds automatic release triggering after the release voting
has been successful. It will run the pre-release checks and if they pass
it will do the release itself.

Reference: #21
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Nov 25, 2024
1 parent 362727f commit d75fbd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Pre-Release
on: workflow_dispatch

on:
workflow_dispatch:
workflow_call:
jobs:

release-test:
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/release-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
release-vote:
name: release vote
runs-on: ubuntu-20.04
outputs:
release: ${{ steps.vote_count.outputs.release }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand Down Expand Up @@ -82,6 +84,7 @@ jobs:
fi
- name: Count votes
if: ${{ env.TIME_FOR_VOTE == 1 }}
id: vote_count
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
Expand Down Expand Up @@ -125,6 +128,7 @@ jobs:
}'
echo "It is time for release."
echo 'TIME_FOR_RELEASE=1' >> $GITHUB_ENV
echo "release=1" >> "$GITHUB_OUTPUT"
else
echo "We don't have enought votes."
fi
Expand All @@ -151,9 +155,12 @@ jobs:
}
'
fi
- name: Release
if: ${{ env.TIME_FOR_RELEASE == 1 }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
echo 'RELEASE'
pre-release:
needs: release-vote
secrets: inherit
if: ${{ needs.release-vote.outputs.release == 1 }}
uses: ./.github/workflows/pre-release.yml
release:
needs: pre-release
secrets: inherit
uses: ./.github/workflows/release.yml

0 comments on commit d75fbd5

Please sign in to comment.