👷 update release script

This commit is contained in:
platane
2022-11-03 09:56:54 +01:00
parent b895ed2e0f
commit 21655d1bda

View File

@@ -4,7 +4,10 @@ on:
workflow_dispatch:
inputs:
version:
description: "Version"
description: |
New version for the release
If the version is in format <major>.<minor>.<patch> a new release is emitted.
Otherwise for other format ( for example <major>.<minor>.<patch>-beta.1 ), a prerelease is emitted.
default: "0.0.1"
required: true
type: string
@@ -15,6 +18,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
@@ -71,15 +76,15 @@ jobs:
git tag v$( echo $VERSION | cut -d. -f 1-1 )
git tag v$( echo $VERSION | cut -d. -f 1-2 )
git push origin --tags --force
echo ::set-output name=prerelease::false
echo "prerelease=false" >> $GITHUB_OUTPUT
else
echo ::set-output name=prerelease::true
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
- uses: actions/create-release@v1
- uses: ncipollo/release-action@v1.11.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
tag: v${{ github.event.inputs.version }}
body: ${{ github.event.inputs.description }}
prerelease: ${{ steps.push-tags.outputs.prerelease }}