From 45cd13a21b18eeb5fa367ddcf32be9ff7a592770 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Wed, 22 May 2024 16:56:27 +0200 Subject: [PATCH] ci: add release workflow --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ .releaserc.yml | 18 ++++++++++++++ CHANGELOG.md | 5 ---- 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c2b9e4c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +--- +name: Release + +on: + workflow_dispatch: + inputs: + dryRun: + type: boolean + description: "Dry-Run" + default: false + +concurrency: + # only run one publishing at a time to avoid conflicts + group: publish-${{ github.ref }} + +jobs: + release: + uses: wetransform/gha-workflows/.github/workflows/gradle-library-publish.yml@feat/release-outputs # TODO merge related branch and replace with release version once tested + with: + java-version: 17 + build-tasks: clean check distZip buildDeb + publish-tasks: publish + multi-module: false + semantic-release: true + semantic-release-dryrun: ${{ inputs.dryRun }} + secrets: + SLACK_NOTIFICATIONS_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + WETF_ARTIFACTORY_USER: ${{ secrets.WETF_ARTIFACTORY_USER }} + WETF_ARTIFACTORY_PASSWORD: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }} + WE_RELEASE_GITHUB_APP_ID: ${{ secrets.WE_RELEASE_GITHUB_APP_ID }} + WE_RELEASE_GITHUB_PRIVATE_KEY: ${{ secrets.WE_RELEASE_GITHUB_PRIVATE_KEY }} + + docker: + needs: [release] + if: ${{ needs.release.outputs.release-published != 'false' && needs.release.outputs.release-published != '' }} + uses: wetransform/gha-workflows/.github/workflows/gradle-service-publish.yml@feat/release-outputs # TODO merge related branch and replace with release version once tested + with: + checkout-ref: refs/tags/v${{needs.release.outputs.release-version}} # check out release tag + java-version: 17 + image-tag: wetransform/hale-cli:latest # image to scan + # don't run tests since this is already done in artifacts + gradle-tasks: clean dockerPushImage + expect-tests: false + secrets: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} + SLACK_NOTIFICATIONS_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..1751e83 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,18 @@ +--- +branches: master + +plugins: + - - "@semantic-release/commit-analyzer" + - preset: conventionalcommits + - - "@semantic-release/release-notes-generator" + - preset: conventionalcommits + - "@semantic-release/changelog" + - - "@semantic-release/exec" + - verifyReleaseCmd: ./gradlew verifyNoSnapshotDependencies + publishCmd: RELEASE=true ./gradlew showVersion verifyReleaseVersion $PUBLISH_TASKS + - - "@semantic-release/git" + - assets: + - CHANGELOG.md + - - "@semantic-release/github" + - assets: + - build/distributions/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f0f429..c5a5d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,3 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See the [change log guidelines](http://keepachangelog.com/) for information on how to structure the file. - ## [5.1.0] ### Added