ci(release): add workflow_dispatch input for manual release tagging
Some checks failed
CI / build-and-test (push) Failing after -30m40s
Some checks failed
CI / build-and-test (push) Failing after -30m40s
This commit is contained in:
@@ -4,6 +4,11 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Tag to release (e.g. v1.2.3)'
|
||||
required: true
|
||||
|
||||
env:
|
||||
GITEA_SERVER: https://git.warky.dev
|
||||
@@ -38,7 +43,8 @@ jobs:
|
||||
- name: Set build vars
|
||||
id: vars
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
|
||||
TAG="${{ github.event.inputs.tag || github.ref_name }}"
|
||||
echo "VERSION=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
echo "BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -66,21 +72,21 @@ jobs:
|
||||
- name: Create Gitea Release
|
||||
id: create_release
|
||||
run: |
|
||||
VERSION="${{ steps.vars.outputs.VERSION }}"
|
||||
export VERSION="${{ steps.vars.outputs.VERSION }}"
|
||||
BODY=$(python3 <<'PY'
|
||||
import json, subprocess, os
|
||||
version = os.environ['VERSION']
|
||||
commit = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], text=True).strip()
|
||||
body = f"## {version}\n\nBuilt from commit {commit}.\n\nSee `checksums.txt` to verify downloads."
|
||||
print(json.dumps({
|
||||
import json, subprocess, os
|
||||
version = os.environ['VERSION']
|
||||
commit = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], text=True).strip()
|
||||
body = f"## {version}\n\nBuilt from commit {commit}.\n\nSee `checksums.txt` to verify downloads."
|
||||
print(json.dumps({
|
||||
'tag_name': version,
|
||||
'name': version,
|
||||
'body': body,
|
||||
'draft': False,
|
||||
'prerelease': False,
|
||||
}))
|
||||
PY
|
||||
)
|
||||
}))
|
||||
PY
|
||||
)
|
||||
RESPONSE=$(curl -fsS -X POST "${{ env.GITEA_SERVER }}/api/v1/repos/${{ env.GITEA_REPO }}/releases" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
||||
Reference in New Issue
Block a user