feat: matchcal A-Z (#94) #50
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: "Automatic Release" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Get latest release | |
| id: get-latest-release | |
| uses: InsonusK/[email protected] | |
| with: | |
| myToken: ${{ github.token }} | |
| view_top: 1 | |
| - name: Get next tag | |
| id: next-tag | |
| run: | | |
| prev_version=$(echo "${{ steps.get-latest-release.outputs.tag_name }}" | sed -E 's/\..*//g') | |
| echo "Previous version: $((prev_version))" | |
| echo "Next version: $((prev_version+1))" | |
| echo "::set-output name=tag::$((prev_version+1)).0" | |
| - name: Create tag | |
| uses: tvdias/[email protected] | |
| with: | |
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
| tag: ${{ steps.next-tag.outputs.tag }} | |
| - name: Count shortcuts in dictionary | |
| id: count-shortcuts | |
| run: echo "::set-output name=count::$(tail -n +2 dictionary.txt | wc -l)" | |
| - uses: fregante/release-with-changelog@v3 | |
| id: release-with-changelog | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| exclude: '^meta|^docs|^document|^lint|^ci|^refactor|readme|workflow|bump|dependencies|yml|^v?\d+\.\d+\.\d+' | |
| tag: ${{ steps.next-tag.outputs.tag }} | |
| title: '${{ steps.next-tag.outputs.tag }} - ${{ steps.count-shortcuts.outputs.count }} shortcuts' | |
| commit-template: '- {hash} {title}' | |
| skip-on-empty: true | |
| template: | | |
| ### Changelog | |
| {commits} | |
| {range} | |
| - name: Delete tag if release skipped | |
| if: ${{ steps.release-with-changelog.outputs.skipped == 'true' }} | |
| run: | | |
| git tag -d ${{ steps.next-tag.outputs.tag }} | |
| git push origin :refs/tags/${{ steps.next-tag.outputs.tag }} | |
| - name: Update readme | |
| if: ${{ steps.release-with-changelog.outputs.skipped == 'false' }} | |
| run: | | |
| UPDATE=$(cat README.md | sed -E 's|(https://github.com/DenverCoder1/LaTeX-Gboard-Dictionary/archive/).*|\1${{ steps.next-tag.outputs.tag }}.zip|g') | |
| echo "${UPDATE}" > README.md | |
| - uses: EndBug/add-and-commit@v7 | |
| if: ${{ steps.release-with-changelog.outputs.skipped == 'false' }} | |
| with: | |
| message: 'docs: Bump version to ${{ steps.next-tag.outputs.tag }}' | |
| default_author: github_actions |