From 83fadd0c2c993848a38e102cb652d1c9068bd570 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Wed, 13 Mar 2024 16:25:29 +0100 Subject: [PATCH] ci: add GitHub Actions for testing and publishing --- .github/workflows/check.yml | 22 ++++++++++++++++++++++ .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..923922b --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,22 @@ +name: Check + +on: + pull_request: + branches: + - master + - devel + +jobs: + check: + uses: wetransform/gha-workflows/.github/workflows/gradle-library-check.yml@master + with: + java-version: 17 + + docker: + uses: wetransform/gha-workflows/.github/workflows/gradle-service-check.yml@master + with: + java-version: 17 + image-tag: wetransform/hale-cli:latest + # don't run tests since this is already done in check + gradle-tasks: clean dockerTagLatest + expect-tests: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9427784 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + push: + branches: + - devel + - master + workflow_dispatch: {} + +concurrency: + # only run one publishing at a time to avoid conflicts in artifactory + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + artifacts: + uses: wetransform/gha-workflows/.github/workflows/gradle-library.yml@master + with: + java-version: 17 + gradle-tasks: clean check distZip buildDeb publish + upload-artifact-path: build/distributions + upload-artifact-name: distributions + secrets: + SLACK_NOTIFICATIONS_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + + docker: + # FIXME both master and devel will push latest - only one should + uses: wetransform/gha-workflows/.github/workflows/gradle-service-publish.yml@master + with: + java-version: 17 + image-tag: wetransform/hale-cli:latest + secrets: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} + SLACK_NOTIFICATIONS_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}