Release new version #12
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: Release new version | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| generate-new-release: | |
| environment: | |
| name: release-approval | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| - name: Install installer package | |
| run: pip install xmipp3_installer | |
| - name: Retrieve tag name, release name & changelog | |
| run: | | |
| echo "TAG_NAME=$(./xmipp version --short)" >> $GITHUB_OUTPUT | |
| awk '/## Release/{if (p) exit; p=1} p' CHANGELOG.md > latest_changelog_with_title.md | |
| cat latest_changelog_with_title.md | tail -n +2 > latest_changelog.md | |
| echo "RELEASE_NAME=$(cat latest_changelog_with_title.md | head -n 1 | sed 's/## Release //' | sed 's/^ *//')" >> $GITHUB_OUTPUT | |
| id: variables | |
| - name: Generate tag | |
| id: tag_version | |
| uses: mathieudutour/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| custom_tag: ${{ steps.variables.outputs.TAG_NAME }} | |
| tag_prefix: '' | |
| - name: Update major version tag | |
| run: | | |
| VERSION=${{ steps.variables.outputs.TAG_NAME }} | |
| MAJOR=${VERSION%%.*} | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email '[email protected]' | |
| git tag -fa "${MAJOR}" -m 'Update major version tag with $VERSION' | |
| git push origin "${MAJOR}" --force | |
| - name: Create a GitHub release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ steps.tag_version.outputs.new_tag }} | |
| name: ${{ steps.variables.outputs.RELEASE_NAME }} | |
| bodyFile: latest_changelog.md |