-
Notifications
You must be signed in to change notification settings - Fork 314
70 lines (62 loc) · 2.46 KB
/
cli-release.yaml
File metadata and controls
70 lines (62 loc) · 2.46 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
name: CLI Release
on:
push:
tags:
- 'cli/v*'
permissions:
contents: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: Generate Changelog
run: |
bash .github/scripts/generate-changelog.sh \
--tag-prefix "cli/v" \
--source-dir "src/client/acontext-cli" \
--display-name "CLI" \
--output "${{ github.workspace }}-CHANGELOG.txt" \
--footer "Binary artifacts are available in this release."
- name: Create Release with Notes
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
upload-binaries:
name: Upload Binaries
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Read Go version from go.mod
id: go-version
run: |
GO_VERSION=$(grep '^go ' src/client/acontext-cli/go.mod | awk '{print $2}')
echo "version=$GO_VERSION" >> "$GITHUB_OUTPUT"
- name: Go Release Binaries
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b
with:
goversion: ${{ steps.go-version.outputs.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
release_tag: ${{ github.ref_name }}
overwrite: true
pre_command: export CGO_ENABLED=0
ldflags: -s -w -extldflags -static -X main.cliVersion=${{ github.ref_name }} -X github.com/memodb-io/Acontext/acontext-cli/internal/telemetry.telemetryBearerToken=${{ secrets.CLI_TELEMETRY_BEARER_TOKEN }} -X github.com/memodb-io/Acontext/acontext-cli/internal/auth.SupabaseURL=${{ secrets.CLI_SUPABASE_URL }} -X github.com/memodb-io/Acontext/acontext-cli/internal/auth.SupabaseAnonKey=${{ secrets.CLI_SUPABASE_ANON_KEY }}
project_path: src/client/acontext-cli
binary_name: acontext-cli
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"