-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce jreleaser build and release workflow
- Loading branch information
Rounak Datta
committed
Aug 7, 2023
1 parent
99b7f2b
commit a18d9e7
Showing
3 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Publish CLI Artifacts | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_assemble: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Build Binary | ||
run: ./gradlew runDebugExecutableNative | ||
|
||
- name: Assemble (rename etc) the binaries | ||
uses: jreleaser/release-action@v2 | ||
with: | ||
arguments: assemble | ||
env: | ||
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JRELEASER_PLATFORM_OVERRIDE: ${{ matrix.job.jreleaser_platform }} | ||
|
||
- name: Stage (i.e. upload, but not yet release) artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
retention-days: 1 | ||
name: artifacts | ||
path: | | ||
out/jreleaser/cmdk/archive/*.zip | ||
release: | ||
needs: [ build_and_assemble ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download the staged artifacts | ||
uses: actions/download-artifact@v3 | ||
# the default directory where the artifacts get downloaded is `artifacts` | ||
|
||
- name: Release with grandeur | ||
uses: jreleaser/release-action@v2 | ||
with: | ||
arguments: full-release -PartifactsDir=artifacts -PskipArchiveResolver | ||
env: | ||
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
project: | ||
name: cmdk | ||
description: cmdk is the command line client to interact with the CommandK platform | ||
links: | ||
homepage: https://github.com/commandk-dev/cli | ||
java: | ||
groupId: dev.commandk | ||
version: 17 | ||
inceptionYear: 2023 | ||
stereotype: cli | ||
|
||
release: | ||
github: | ||
branch: main | ||
overwrite: true | ||
sign: false | ||
changelog: | ||
formatted: 'ALWAYS' | ||
format: '- {{commitShortHash}} {{commitTitle}}' | ||
preset: 'conventional-commits' | ||
contributors: | ||
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}' | ||
|
||
signing: | ||
active: never | ||
armored: true | ||
|
||
assemble: | ||
archive: | ||
cmdk-cli-client: | ||
active: ALWAYS | ||
attachPlatform: true | ||
fileSets: | ||
- input: 'build/bin/native/releaseExecutable' | ||
output: 'bin' | ||
includes: [ 'cli.kexe' ] | ||
mapper: | ||
type: 'identity' | ||
includes: | ||
- pattern: 'cli.kexe' | ||
to: 'cmdk-${platform}' | ||
|
||
environment: | ||
properties: | ||
artifactsDir: out/jreleaser/cmdk/archive | ||
|
||
distributions: | ||
cmdk: | ||
artifacts: | ||
- path: "{{artifactsDir}}/cmdk-{{platform}}" | ||
platform: "linux-x86_64" |