generated from camunda-community-hub/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from camunda-community-hub/meg-22613-release-wo…
…rkflow ci: release workflow
- Loading branch information
Showing
1 changed file
with
48 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,48 @@ | ||
name: Release Go Client | ||
on: | ||
push: | ||
branches: | ||
- 'release/**' | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- 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 clients/go/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}" | ||
if [ "$PUSH_CHANGES" = "true" ]; then | ||
git push origin "v${RELEASE_VERSION}" | ||
fi | ||
- name: Create Github release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: ${{ env.RELEASE_VERSION }} | ||
artifacts: "cmd/zbctl/dist/*" | ||
artifactErrorsFailBuild: true | ||
generateReleaseNotes: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: v${{ env.RELEASE_VERSION }} |