Skip to content

PRD-000 Fix user-agent header in CLI client (#5) #20

PRD-000 Fix user-agent header in CLI client (#5)

PRD-000 Fix user-agent header in CLI client (#5) #20

name: Publish CLI Artifacts
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*' # v0.0.1 - this syntax of tags is supported
jobs:
build_and_assemble:
strategy:
matrix:
os: [macos-13, 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: Install prerequisites for Linux runner
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libcurl4-openssl-dev
- name: Build Binary
run: ./gradlew linkDebugExecutableNative
- name: Rename the Linux binary appropriately
if: matrix.os == 'ubuntu-latest'
working-directory: ./build/bin/native/debugExecutable
run: |
mv cli.kexe cmdk-linux-x86_64
- name: Rename the macOS binary appropriately
if: matrix.os == 'macos-13'
working-directory: ./build/bin/native/debugExecutable
run: |
mv cli.kexe cmdk-osx-x86_64
- name: Determine the release version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
env:
GITHUB_REF: ${{ github.ref }}
- name: Assemble (rename etc) the binaries
uses: jreleaser/release-action@v2
with:
arguments: assemble
env:
JRELEASER_PROJECT_VERSION: ${{ env.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/assemble/cmdk-cli-client/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: Determine the release version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
env:
GITHUB_REF: ${{ github.ref }}
- name: Release with grandeur
uses: jreleaser/release-action@v2
with:
arguments: full-release -PartifactsDir=artifacts -PskipArchiveResolver
env:
JRELEASER_PROJECT_VERSION: ${{ env.VERSION }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_PLATFORM_OVERRIDE: ${{ matrix.job.jreleaser_platform }}