From 27ebc6388d4a31fea84523196046f9f2a391cceb Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Sun, 4 Jun 2023 17:40:38 +0200 Subject: [PATCH] Add Jreleaser to GH Action Signed-off-by: Paolo Di Tommaso --- .github/workflows/build.yml | 45 ++++++++++++++++++- jreleaser.yml | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 jreleaser.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a58fbc..303e9aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,47 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v3 with: - name: wavelit-${{ matrix.os }} - path: ./app/build/native/nativeCompile/wavelit + name: nativeCompile-${{ matrix.os }} + path: ./app/build/native/nativeCompile + release: + name: Release +# if: "contains(github.event.head_commit.message, '[release]') && github.event.ref=='refs/heads/master'" + needs: [ build ] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download all build artifacts + uses: actions/download-artifact@v2 + + - name: Setup Java for JReleaser + uses: actions/setup-java@v3 + with: + java-version: 19 + distribution: 'adopt' + + - name: Version + id: version + run: | + VERSION=$(cat ./VERSION) + echo "VERSION=$VERSION" + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Run JReleaser + uses: jreleaser/release-action@v2 + env: + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JRELEASER_PROJECT_VERSION: ${{ steps.version.outputs.VERSION }} + + - name: JReleaser release output + if: always() + uses: actions/upload-artifact@v3 + with: + name: jreleaser-release + path: | + out/jreleaser/trace.log + out/jreleaser/output.properties ... diff --git a/jreleaser.yml b/jreleaser.yml new file mode 100644 index 0000000..0ee7609 --- /dev/null +++ b/jreleaser.yml @@ -0,0 +1,87 @@ +project: + name: wavelit + description: Wavelit CLI + longDescription: Command line tool for Wave container provisioning + website: https://github.com/seqeralabs/wavelit + authors: + - Seqera Labs + license: MPL-2.0 + extraProperties: + inceptionYear: 2023 + +release: + github: + overwrite: true + draft: true + prerelease: + pattern: .*-beta + changelog: + formatted: ALWAYS + format: '- {{commitShortHash}} {{commitTitle}}' + contributors: + format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}' + labelers: + - label: 'feature' + title: 'Resolves #' + body: 'Resolves #' + - label: 'feature' + title: '[feature]' + - label: 'issue' + title: 'Fixes #' + body: 'Fixes #' + - label: 'issue' + title: 'Relates to #' + body: 'Relates to #' + - label: 'issue' + title: '[bug]' + - label: 'task' + title: '[task]' + - label: 'merge_pull' + title: 'Merge pull' + - label: 'merge_branch' + title: 'Merge branch' + - label: 'release' + title: '[release]' + categories: + - title: '🚀 Features' + labels: + - 'feature' + - title: '✅ Issues' + labels: + - 'issue' + - title: '🧰 Tasks' + labels: + - 'task' + - title: 'Merge' + labels: + - 'merge_pull' + - 'merge_branch' + - title: 'Release' + labels: + - 'release' + hide: + categories: + - 'Merge' + - 'Release' + contributors: + - 'GitHub' + replacers: + - search: ' \[feature\]' + - search: ' \[bug\]' + - search: ' \[task\]' + - search: ' \[skip ci\]' + - search: ' \[release\]' + +distributions: + wavelit: + type: NATIVE_IMAGE + artifacts: + - path: "nativeCompile-ubuntu-latest/wavelit" + transform: "{{distributionName}}-{{projectEffectiveVersion}}-linux-x86_64" + platform: linux-x86_64 + - path: "nativeCompile-macos-latest/wavelit" + transform: "{{distributionName}}-{{projectEffectiveVersion}}-osx-x86_64" + platform: osx-x86_64 + - path: "nativeCompile-windows-latest/wavelit.exe" + transform: "{{distributionName}}-{{projectEffectiveVersion}}-windows-x86_64.exe" + platform: windows-x86_64