-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (62 loc) · 1.79 KB
/
release.yml
File metadata and controls
71 lines (62 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
workflow_dispatch:
inputs:
channel:
description: "Release channel"
required: true
type: choice
options:
- next
- finalize
- stable
default: next
bump:
description: "Version bump (next and stable only)"
required: false
type: choice
options:
- patch
- minor
- major
default: patch
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write
jobs:
release:
name: Release (${{ inputs.channel }}${{ inputs.channel != 'finalize' && format(' {0}', inputs.bump) || '' }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout main
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Bump version, commit, and tag
run: |
if [ "${{ inputs.channel }}" = "next" ]; then
bun run release next ${{ inputs.bump }}
elif [ "${{ inputs.channel }}" = "finalize" ]; then
bun run release finalize
else
bun run release ${{ inputs.bump }}
fi
- name: Create GitHub Release
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"-next."* ]]; then
gh release create "v${VERSION}" --generate-notes --prerelease
else
gh release create "v${VERSION}" --generate-notes
fi
env:
GH_TOKEN: ${{ github.token }}