ci: add workflow_dispatch trigger and RELEASE_TAG env var
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a6b0a8de08
commit
b817d2bed4
@ -3,11 +3,19 @@ name: Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- v*
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Release tag (e.g. v0.1.0-rc1)'
|
||||||
|
required: true
|
||||||
|
default: 'v0.1.0-rc1'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-amd64:
|
build-linux-amd64:
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
steps:
|
steps:
|
||||||
@ -37,7 +45,7 @@ jobs:
|
|||||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
TAG="$GITHUB_REF_NAME"
|
TAG="$RELEASE_TAG"
|
||||||
# Create release (idempotent)
|
# Create release (idempotent)
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
@ -55,6 +63,8 @@ jobs:
|
|||||||
|
|
||||||
build-windows-amd64:
|
build-windows-amd64:
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
steps:
|
steps:
|
||||||
@ -86,7 +96,7 @@ jobs:
|
|||||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
TAG="$GITHUB_REF_NAME"
|
TAG="$RELEASE_TAG"
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
@ -102,6 +112,8 @@ jobs:
|
|||||||
|
|
||||||
build-linux-arm64:
|
build-linux-arm64:
|
||||||
runs-on: linux-arm64
|
runs-on: linux-arm64
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
steps:
|
steps:
|
||||||
@ -131,7 +143,7 @@ jobs:
|
|||||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
TAG="$GITHUB_REF_NAME"
|
TAG="$RELEASE_TAG"
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user