feat: initial version #9
Workflow file for this run
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 | |
permissions: | |
contents: write # required for github_token to create release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Release | |
id: setup-release | |
uses: LizardByte/setup-release-action@master | |
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_stable_release=False | |
release_tag=pr-${{ github.event.pull_request.number }}-${{ github.run_id }} | |
token=${{ secrets.GITHUB_TOKEN }} | |
else | |
discussion_category=announcements | |
publish_stable_release=${{ steps.setup-release.outputs.publish_stable_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_stable_release != 'True' }} | |
tag: ${{ steps.vars.outputs.release_tag }} | |
token: ${{ steps.vars.outputs.token }} | |
- name: Delete Release | |
env: | |
GITHUB_TOKEN: ${{ steps.vars.outputs.token }} | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: dev-drprasad/delete-tag-and-release@v0.2.1 | |
with: | |
tag_name: ${{ steps.vars.outputs.release_tag }} |