Skip to content

Instantly share code, notes, and snippets.

@stephdotnet
Last active May 12, 2023 06:43
Show Gist options
  • Save stephdotnet/ae0c2cc504d40df60ddd04762d0f621c to your computer and use it in GitHub Desktop.
Save stephdotnet/ae0c2cc504d40df60ddd04762d0f621c to your computer and use it in GitHub Desktop.
Semantic Release
name: Semantic Release
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
release:
permissions:
contents: write # to create a release (ncipollo/release-action)
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: main
noVersionBumpBehavior: 'silent'
- name: Create Release
if: steps.semver.outputs.nextStrict != ''
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
makeLatest: true
tag: ${{ steps.semver.outputs.nextStrict }}
name: ${{ steps.semver.outputs.nextStrict }}
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment