Create Release #40
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: Create Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseversion: | |
| description: 'Specify release version (e.g. 2.0.1)' | |
| required: true | |
| default: '' | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Replace Versions | |
| run: | | |
| sed -i "s/^version = .*$/version = \"${{github.event.inputs.releaseversion}}\"/g" pyproject.toml | |
| sed -i "s/^__version__ = .*$/__version__ = \"${{github.event.inputs.releaseversion}}\"/g" atcodertools/release_management/version.py | |
| - name: Make sure diff exists | |
| run: | | |
| ! git diff --stat --exit-code atcodertools/release_management/version.py | |
| ! git diff --stat --exit-code pyproject.toml | |
| - uses: EndBug/[email protected] | |
| with: | |
| author_name: github-actions | |
| author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Get latest commitish | |
| run: echo "COMMITISH=`git rev-parse HEAD`" >> $GITHUB_ENV | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| commitish: ${{ env.COMMITISH }} | |
| tag_name: ${{ github.event.inputs.releaseversion }} | |
| release_name: Release ${{ github.event.inputs.releaseversion }} | |
| body: | | |
| Release version ${{ github.event.inputs.releaseversion }} | |
| draft: false | |
| prerelease: false |