ci: update prerelease condition for setup release action (#13) #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
pull_request: | |
branches: [master] | |
types: [opened, synchronize, reopened] | |
push: | |
branches: [master] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
action: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Release | |
id: setup-release | |
uses: LizardByte/setup-release-action@master # keep this on master, to prevent endless depandabot PRs | |
with: | |
changelog_path: ./tests/data/set${{ matrix.set }}/CHANGELOG.md | |
fail_on_events_api_error: false | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set action variables | |
id: vars | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
discussion_category=tests | |
publish_pre_release=true | |
release_tag=pr-${{ github.event.pull_request.number }}-${{ github.run_id }} | |
token=${{ secrets.GITHUB_TOKEN }} | |
else | |
discussion_category=announcements | |
publish_pre_release=${{ steps.setup-release.outputs.publish_pre_release }} | |
release_tag=${{ steps.setup-release.outputs.release_tag }} | |
token=${{ secrets.GH_BOT_TOKEN }} | |
fi | |
# set outputs | |
echo "discussion_category=$discussion_category" >> $GITHUB_OUTPUT | |
echo "publish_stable_release=$publish_stable_release" >> $GITHUB_OUTPUT | |
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT | |
echo "token=$token" >> $GITHUB_OUTPUT | |
- name: Run Action | |
id: action | |
uses: ./ | |
with: | |
allowUpdates: false | |
artifacts: '' | |
body: '' | |
discussionCategory: ${{ steps.vars.outputs.discussion_category }} | |
generateReleaseNotes: true | |
name: ${{ steps.vars.outputs.release_tag }} | |
prerelease: ${{ steps.vars.outputs.publish_pre_release == 'true' }} | |
tag: ${{ steps.vars.outputs.release_tag }} | |
token: ${{ steps.vars.outputs.token }} | |
- name: Sleep | |
if: ${{ always() && github.event_name == 'pull_request' }} | |
run: sleep 30 | |
- name: Delete Release | |
env: | |
GITHUB_TOKEN: ${{ steps.vars.outputs.token }} | |
if: ${{ always() && github.event_name == 'pull_request' }} | |
uses: dev-drprasad/delete-tag-and-release@v0.2.1 | |
with: | |
tag_name: ${{ steps.vars.outputs.release_tag }} |