Skip to content

Update README.md

Update README.md #70

name: Tag and release
on:
push:
branches: [ "master" ]
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Calculate new version
id: tag_version
uses: mathieudutour/[email protected]
with:
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_release_rules: |
"fix:patch,hotfix:patch,patch:patch,feature:minor,change:minor,minor:minor,breaking:major,major:major"
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
new_version: ${{ steps.tag_version.outputs.new_version}}
changelog: ${{ steps.tag_version.outputs.changelog }}
release_type: ${{ steps.tag_version.outputs.release_type }}
write:
needs: bump
runs-on: ubuntu-latest
name: Write version to file
steps:
- uses: actions/checkout@v2
- name: Get current version
uses: haessar/write-version-to-file-action@v1
with:
version: ${{ needs.bump.outputs.new_tag }}
path: ./.version
file-type: txt
- name: Get new sha
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo "SHA=$sha_new" >> $GITHUB_OUTPUT
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
tag:
needs: [bump, write]
runs-on: ubuntu-latest
steps:
- name: Push tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.bump.outputs.new_version }}
commit_sha: ${{ needs.write.outputs.new_sha }}
release:
needs: [bump, tag]
if: ${{ contains(fromJSON('["minor", "major"]'), needs.bump.outputs.release_type) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.bump.outputs.new_tag }}
name: Release ${{ needs.bump.outputs.new_tag }}
body: ${{ needs.bump.outputs.changelog }}
draft: true