👷 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: workflow_dispatch:
inputs: inputs:
version: 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" default: "0.0.1"
required: true required: true
type: string type: string
@@ -15,6 +18,8 @@ on:
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v2 - 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-1 )
git tag v$( echo $VERSION | cut -d. -f 1-2 ) git tag v$( echo $VERSION | cut -d. -f 1-2 )
git push origin --tags --force git push origin --tags --force
echo ::set-output name=prerelease::false echo "prerelease=false" >> $GITHUB_OUTPUT
else else
echo ::set-output name=prerelease::true echo "prerelease=true" >> $GITHUB_OUTPUT
fi fi
- uses: actions/create-release@v1 - uses: ncipollo/release-action@v1.11.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: v${{ github.event.inputs.version }} tag: v${{ github.event.inputs.version }}
body: ${{ github.event.inputs.description }} body: ${{ github.event.inputs.description }}
prerelease: ${{ steps.push-tags.outputs.prerelease }} prerelease: ${{ steps.push-tags.outputs.prerelease }}