diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 561ac612..b661d96f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,6 +4,7 @@ on: env: BRANCH: 3.4.14 + ZK_VERSION: 3.4.14 jobs: package: @@ -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 brandwatch-bot-github@brandwatch.com + 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 }} diff --git a/Makefile b/Makefile index 6c222908..32ba37ab 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +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 @@ -5,3 +10,10 @@ package: .PHONY: clean clean: ant clean + +ifdef GITHUB_ENV +.PHONY: get-tag +get-tag: + @echo "BUILD_TAG=${BUILD_TAG}" + @echo "RELEASE_TAG=${RELEASE_TAG}" +endif