try release #13
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: Release | |
permissions: | |
contents: write | |
on: | |
pull_request: | |
branches: | |
- "main" | |
types: | |
- closed | |
jobs: | |
check-version: | |
if: contains(github.event.pull_request.head.ref, 'release/v') && github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Check version | |
run: python utils/check_version.py | |
- name: Set outputs | |
id: version_check | |
run: | | |
echo "new_release=${{ env.NEW_RELEASE }}" >> $GITHUB_OUTPUT | |
echo "action_name=${{ env.ACTION_NAME }}" >> $GITHUB_OUTPUT | |
echo "action_version=${{ env.ACTION_VERSION }}" >> $GITHUB_OUTPUT | |
outputs: | |
new_release: ${{ steps.version_check.outputs.new_release }} | |
action_name: ${{ steps.version_check.outputs.action_name }} | |
action_version: ${{ steps.version_check.outputs.action_version }} | |
prepare-release: | |
needs: check-version | |
if: ${{ needs.check-version.outputs.new_release == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Extract release notes from ${{needs.check-version.outputs.action_name}}/RELEASE.md | |
id: extract | |
run: | | |
python utils/extract_release_notes.py \ | |
"RELEASE.md" \ | |
"Release ${{needs.check-version.outputs.action_version}}" | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{needs.check-version.outputs.action_version}} | |
name: v${{needs.check-version.outputs.action_version}} | |
body_path: release_body.txt | |
draft: false | |
prerelease: false | |
# token: ${{ secrets.GH_TAGGING_TOKEN }} | |
files: | | |
action.yml | |
README.md | |
LICENSE.md |