Post Release #3
Workflow file for this run
This file contains hidden or 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: Post Release | |
| on: | |
| # Once draft release is released, trigger the docs release | |
| release: | |
| types: | |
| ## pre-release and stable release | |
| #- published | |
| ## stable release only | |
| - released | |
| jobs: | |
| call-publish-docs: | |
| uses: ./.github/workflows/docs.yaml | |
| update-version: | |
| permissions: | |
| # write permission is required to update version.py | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update version.py | |
| id: update_version | |
| run: | | |
| VERSION=$(echo "${{ github.event.release.name }}" | grep -oP '\d+\.\d+\.\d+') | |
| sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" datajoint/version.py | |
| cat datajoint/version.py | |
| # Commit the changes | |
| git config --global user.name "github-actions" | |
| git config --global user.email "[email protected]" | |
| git add datajoint/version.py | |
| git commit -m "Update version.py to $VERSION" | |
| git push | |
| slack-notification: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Post a message in a channel | |
| uses: slackapi/[email protected] | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": "*New Release Published!* :tada: \n*Repository:* ${{ github.repository }}\n*Version:* ${{ github.event.release.tag_name }}\n*URL:* ${{ github.event.release.html_url }}", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "*New Release Published!* :tada:\n*Repository:* ${{ github.repository }}\n*Version:* ${{ github.event.release.tag_name }}\n*URL:* <${{ github.event.release.html_url }}|View Release>" | |
| } | |
| } | |
| ] | |
| } |