generated from camunda-community-hub/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (50 loc) · 1.68 KB
/
release.yml
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
name: Release Go Client
on:
push:
branches:
- 'release/**'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Git User Setup
run: |
git config --global user.email "github-actions[release]"
git config --global user.name "github-actions[release]@users.noreply.github.com"
- name: Get Release version
shell: bash
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | egrep -o "[0-9]\.[0-9]\.[0-9]{1,2}(-.*)")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_ENV"
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Set and commit Go Client version
run: |
pushd internal/embedded
echo "${RELEASE_VERSION}" > data/VERSION
git commit -am "build(project): update go embedded version data"
- name: Build Go Client
shell: bash
id: build-go
working-directory: cmd/zbctl
run: ./build.sh
- name: Run Go Client tests
working-directory: .
run: go test -mod=vendor -v ./...
- name: Go Post-Release
run: |
# Publish Go tag for the release
git tag "v${RELEASE_VERSION}"
git push origin "v${RELEASE_VERSION}"
- name: Create Github release
uses: ncipollo/release-action@v1
with:
name: ${{ env.RELEASE_VERSION }}
artifacts: "cmd/zbctl/dist/zbctl,cmd/zbctl/dist/zbctl.exe,cmd/zbctl/dist/zbctl.darwin"
artifactErrorsFailBuild: true
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.RELEASE_VERSION }}