Skip to content

feat(cli): update CLOUDFLARE_WORKER_URL (#340) #41

feat(cli): update CLOUDFLARE_WORKER_URL (#340)

feat(cli): update CLOUDFLARE_WORKER_URL (#340) #41

Workflow file for this run

name: CLI Release
on:
push:
tags:
- 'cli/v*'
workflow_dispatch:
permissions:
contents: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Extract version from tag
id: version
run: |
TAG_NAME=${GITHUB_REF#refs/tags/cli/v}
echo "version=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Generate Changelog
run: |
echo "# CLI v${{ steps.version.outputs.version }}" > ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "Binary artifacts are available in this release." >> ${{ github.workspace }}-CHANGELOG.txt
- name: Create Release with Notes
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
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 # v6
- 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 # v1
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 }}
project_path: src/client/acontext-cli
binary_name: acontext-cli
asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}"