Skip to content

Commit

Permalink
make release action run manually
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed May 13, 2024
1 parent 28cb1ae commit 8fa76e7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/release-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
name: release-snap

on:
push:
tags:
- v*
workflow_dispatch:
inputs:
version:
description: 'release version, like v1.2.0-beta.1'
required: true
isStable:
description: 'true for a stable release, otherwise false'
required: false
default: 'false'

jobs:
release-snap:
Expand All @@ -32,18 +38,12 @@ jobs:
- name: extract version
id: version
run: |
VERSION=${GITHUB_REF#refs/*/}
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ "${VERSION}" == "${BRANCH_NAME}" ]]; then
VERSION=$(git rev-parse --short HEAD)
fi
PRERELEASE=${VERSION#*-rc}
if [[ -z "$PRERELEASE" || "$PRERELEASE" == "$VERSION" ]]; then
if [[ "${{ github.event.inputs.version }}" == "true" ]]; then
echo "release=stable" >> $GITHUB_OUTPUT
else
echo "release=candidate" >> $GITHUB_OUTPUT
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
- name: make snapcraft
run: |
sed -i 's/{VERSION}/${{ steps.version.outputs.version }}/g' snapcraft.yaml
Expand Down

0 comments on commit 8fa76e7

Please sign in to comment.