Skip to content

Commit 80eca80

Browse files
committed
Add release workflow to default branch
Expose workflow_dispatch so Release can be triggered from Actions/gh while release.sh continues to run against develop.
1 parent 55b8bd0 commit 80eca80

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Requires repository secret RELEASE_TOKEN (fine-grained PAT: Contents read/write on this repo).
2+
# See CONTRIBUTING.md — "Personal access token for releases".
3+
4+
name: Release
5+
6+
run-name: Release v${{ github.event.inputs.version }}
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: "Release version (e.g. 1.2.0), no v prefix"
13+
required: true
14+
type: string
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout develop
24+
uses: actions/checkout@v4
25+
with:
26+
ref: develop
27+
fetch-depth: 0
28+
token: ${{ secrets.RELEASE_TOKEN }}
29+
30+
- name: Configure Git
31+
run: |
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
35+
- name: Install yq
36+
run: |
37+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
38+
sudo chmod +x /usr/local/bin/yq
39+
40+
- name: Run release script
41+
run: ./release.sh "${{ github.event.inputs.version }}"
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
44+
45+
- name: Create GitHub Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
tag_name: ${{ github.event.inputs.version }}
49+
name: Release v${{ github.event.inputs.version }}
50+
body: |
51+
Release v${{ github.event.inputs.version }}
52+
53+
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ github.event.inputs.version }}/CHANGELOG.md) for details.

0 commit comments

Comments
 (0)