-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.79 KB
/
publish_cli_artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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 }}