This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Release Go Client | ||
on: | ||
push: | ||
branches: | ||
- 'release/**' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
RELEASE_BRANCH: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Extract release version from branch | ||
uses: tmelliottjr/extract-regex-action@v1.5.0 | ||
id: release-version | ||
with: | ||
regex: '(?<=release\/).*' | ||
input: ${{ env.RELEASE_BRANCH }} | ||
- name: Set and commit Go Client version | ||
run: | | ||
pushd internal/embedded | ||
echo "${{ steps.release-version.resultString }}" > data/VERSION | ||
git commit -am "build(project): update go embedded version data" | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
cache: true | ||
- name: Build Go Client | ||
shell: bash | ||
id: build-go | ||
working-directory: cmd/zbctl | ||
run: ./build.sh | ||
- name: Collect Release artifacts | ||
id: release-artifacts | ||
run: | | ||
ARTIFACT_DIR=$(mktemp -d) | ||
cp cmd/zbctl/dist/zbctl "${ARTIFACT_DIR}/" | ||
cp cmd/zbctl/dist/zbctl.exe "${ARTIFACT_DIR}/" | ||
cp cmd/zbctl/dist/zbctl.darwin "${ARTIFACT_DIR}/" | ||
echo "dir=${ARTIFACT_DIR}" >> $GITHUB_OUTPUT | ||
- name: Upload Release Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-artifacts | ||
path: ${{ steps.release-artifacts.outputs.dir }} | ||
retention-days: 5 | ||
- name: Go Post-Release | ||
run: | | ||
# Publish Go tag for the release | ||
git tag "clients/go/v${{ steps.release-version.resultString }}" | ||
if [ "$PUSH_CHANGES" = "true" ]; then | ||
git push origin "clients/go/v${{ steps.release-version.resultString }}" | ||
fi |