Skip to content

Merge pull request #20 from robzr/dev #20

Merge pull request #20 from robzr/dev

Merge pull request #20 from robzr/dev #20

Workflow file for this run

name: Release
on:
push:
branches: [main]
env:
GH_TOKEN: ${{ github.token }}
jobs:
Release:
name: Release
permissions: write-all
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- id: get-version
name: Get Version
run: |
echo 'json<<EOF' >>"${GITHUB_OUTPUT}"
./sver json "$(./sver version)" | \
tee -a "$GITHUB_OUTPUT" | \
jq -C
echo EOF >>"${GITHUB_OUTPUT}"
- id: is-existing-release
name: Checking if Release Exists
run: |
if [ -n "$(
gh release list \
--json tagName \
--jq '.[] | .tagName' | \
./sver filter '${{ fromJSON(steps.get-version.outputs.json).version }}'
)" ] ; then
echo exists=true >> "$GITHUB_OUTPUT"
else
echo exists=false >> "$GITHUB_OUTPUT"
fi
- env:
MAJOR: ${{ fromJSON(steps.get-version.outputs.json).major }}
MINOR: ${{ fromJSON(steps.get-version.outputs.json).minor }}
VERSION: v${{ fromJSON(steps.get-version.outputs.json).version }}
if: steps.is-existing-release.outputs.exists == 'false'
name: Create New Release
run: |
gh release \
create "$VERSION" \
--generate-notes \
--latest \
sver
git tag -f "v${MAJOR}"
git tag -f "v${MAJOR}.${MINOR}"
git push -f --tags