Skip to content

Commit

Permalink
Add release push to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbadman committed Mar 26, 2024
1 parent 88bf6a6 commit dd1a2db
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:

env:
BRANCH: 3.4.14
ZK_VERSION: 3.4.14

jobs:
package:
Expand All @@ -19,5 +20,28 @@ jobs:
with:
java-version: 11

- run: |
echo "MAKE_ARGS=BUILD${GITHUB_RUN_NUMBER} ZOOKEEPER_VERSION=${ZK_VERSION} GITHUB_ENV=${GITHUB_ENV}" >> $GITHUB_ENV
- name: Build package
run: make package

- name: Get tag
run: make get-tag ${MAKE_ARGS} >> $GITHUB_ENV

- name: Push tag
run: |
git config user.email [email protected]
git config user.name BrandwatchBot
git tag -am "bw-zookeeper-build release: $RELEASE_TAG" $RELEASE_TAG
git push origin $RELEASE_TAG
- name: Release zookeeper pacakge
uses: softprops/action-gh-release@v1
with:
body: "Release for branch: ${{ env.BRANCH }}."
tag_name: ${{ env.RELEASE_TAG }}
files: |
build/zookeeper-${{ env.ZK_VERSION }}.tar.gz
repository: BrandwatchLtd/bw-zookeeper-build
token: ${{ secrets.BWBOT_BRANDWATCHLTD_GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
ZOOKEEPER_VERSION := 3.4.14
BUILD := local
BUILD_TAG := ${ZOOKEEPER_VERSION}-bwbuild${BUILD}
RELEASE_TAG := releases/bw-zookeeper-build/${BUILD_TAG}

.PHONY: package
package:
ant tar

.PHONY: clean
clean:
ant clean

ifdef GITHUB_ENV
.PHONY: get-tag
get-tag:
@echo "BUILD_TAG=${BUILD_TAG}"
@echo "RELEASE_TAG=${RELEASE_TAG}"
endif

0 comments on commit dd1a2db

Please sign in to comment.