forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
58 lines (49 loc) · 1.71 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
name: release-dcode
on:
workflow_dispatch:
inputs:
version:
description: Release version without the leading v
required: true
type: string
permissions:
contents: write
concurrency: release-dcode-${{ inputs.version }}
jobs:
release:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/setup-bun
- name: Validate version
env:
VERSION: ${{ inputs.version }}
run: |
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "Invalid release version: $VERSION" >&2
exit 1
fi
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ inputs.version }}
run: |
gh release view "v$VERSION" --repo "${{ github.repository }}" >/dev/null 2>&1 || \
gh release create "v$VERSION" --repo "${{ github.repository }}" --draft --generate-notes --target "${{ github.sha }}"
- name: Build and upload CLI archives
working-directory: packages/opencode
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
OPENCODE_CHANNEL: latest
OPENCODE_RELEASE: "1"
OPENCODE_VERSION: ${{ inputs.version }}
run: bun run build
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ inputs.version }}
run: gh release edit "v$VERSION" --repo "${{ github.repository }}" --draft=false --latest