Skip to content

Merge pull request #1 from gmmcal/move-workflows #4

Merge pull request #1 from gmmcal/move-workflows

Merge pull request #1 from gmmcal/move-workflows #4

Workflow file for this run

name: Tag Release
on:
workflow_dispatch:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
majorList: "BREAK"
minorList: "NEW"
patchList: "FIX,OPT"
- name: 🏷️ Create tag ${{ steps.semver.outputs.nextStrict }}
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.semver.outputs.nextStrict }}',
sha: context.sha
})
- name: 🏷️ Create/update tag ${{ steps.semver.outputs.nextMajor }}
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v1',
sha: context.payload.after
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/${{ steps.semver.outputs.nextMajor }}',
sha: context.payload.after
});
})