-
Notifications
You must be signed in to change notification settings - Fork 9
100 lines (96 loc) · 3.7 KB
/
dev-release-cli.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
95
96
97
98
99
100
name: Dev Build and Upload Yaci CLI Zip
#on:
# push:
# tags:
# - 'rel-dev-*'
on:
workflow_dispatch:
jobs:
buildAndPush:
strategy:
matrix:
os: ["ubuntu-20.04", "macos-14"]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-job-reports: 'true'
- name: Get Tag from version file
run: |
TAG=$(grep "tag=" config/version | cut -d'=' -f2)
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
working-directory: applications/cli
run: chmod +x gradlew
- name: Copy CI specific native-image properties
working-directory: applications/cli
if: runner.os == 'Linux'
run: |
echo "os_prefix=linux" >> $GITHUB_ENV
- name: MacOS specific env
if: runner.os == 'macOS'
run: |
echo "os_prefix=macos" >> $GITHUB_ENV
- name: Set lowercase architecture
run: echo "arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build with Gradle
working-directory: applications/cli
run: ./gradlew --no-daemon -i -Pversion=${{ env.TAG }} clean build nativeCompile cliZip
- name: Copy artifacts
working-directory: applications/cli
run: mv build/yaci-cli-${{ env.TAG }}.zip build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip
- uses: actions/upload-artifact@v4
with:
name: yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}
path: ./applications/cli/build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip
windowsBuild:
strategy:
matrix:
os: ["windows-latest"]
runs-on: ${{ matrix.os }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: '21.0.5'
native-image-job-reports: 'true'
- name: Get Tag from (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$TAG = (Get-Content config/version | Where-Object { $_ -match "^tag=" } | ForEach-Object { $_.Split('=')[1].Trim() })
Add-Content -Path $env:GITHUB_ENV -Value "TAG=$TAG"
- name: Windows specific env
run: |
Add-Content -Path $env:GITHUB_ENV -Value "os_prefix=windows"
- name: Set lowercase architecture (Windows)
shell: pwsh
run: |
$arch = "${{ runner.arch }}".ToLower()
Add-Content -Path $env:GITHUB_ENV -Value "arch=$arch"
- name: Build with Gradle
working-directory: applications\cli
run: ./gradlew --no-daemon -i -Pversion="${{ env.TAG }}" clean build nativeCompile cliZip
- name: Copy artifacts
working-directory: applications\cli
run: mv build/yaci-cli-${{ env.TAG }}.zip build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip
- uses: actions/upload-artifact@v4
with:
name: yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}
path: ./applications/cli/build/yaci-cli-${{ env.TAG }}-${{ env.os_prefix }}-${{ env.arch }}.zip