Skip to content

Commit 1408605

Browse files
committed
update ci to also build and release fat jars
1 parent 1563c82 commit 1408605

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
required: false
88
type: boolean
99
default: true
10-
build-all-platforms:
10+
build-native:
1111
description: 'Build for all platforms'
1212
required: false
1313
type: boolean
@@ -18,10 +18,11 @@ on:
1818
branches: [ main ]
1919

2020
jobs:
21-
build:
21+
build-native:
22+
if: ${{ github.event_name != 'push' && inputs.build-native == true }}
2223
strategy:
2324
matrix:
24-
os: ${{ inputs.build-all-platforms == true && fromJSON('["ubuntu-24.04", "windows-2022", "ubuntu-24.04-arm", "macos-15-intel", "macos-14"]') || fromJSON('["ubuntu-24.04"]') }}
25+
os: [ ubuntu-24.04, windows-2022, ubuntu-24.04-arm, macos-15-intel, macos-14 ]
2526
include:
2627
- os: ubuntu-24.04
2728
artifact-name: astra-cli-linux-x86_64
@@ -74,3 +75,25 @@ jobs:
7475
path: build/distributions/*.${{ matrix.artifact-type }}*
7576
if-no-files-found: error
7677
retention-days: 7
78+
79+
build-jar:
80+
runs-on: ubuntu-24.04
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Setup Gradle
86+
uses: gradle/actions/setup-gradle@v4
87+
with:
88+
gradle-version: wrapper
89+
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
90+
91+
- name: Build JAR
92+
run: ./gradlew fatJar -Pprod
93+
94+
- name: Upload JAR artifact
95+
if: inputs.upload-artifacts == true
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: astra-cli-fat-jar
99+
path: build/libs/astra-fat.jar

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: ./.github/workflows/build.yml
4646
with:
4747
upload-artifacts: true
48-
build-all-platforms: true
48+
build-native: true
4949

5050
update-install-scripts:
5151
needs: build
@@ -80,5 +80,6 @@ jobs:
8080
artifacts/astra-cli-linux-arm64/*
8181
artifacts/astra-cli-macos-x86_64/*
8282
artifacts/astra-cli-macos-arm64/*
83+
artifacts/astra-cli-fat-jar/*
8384
env:
8485
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ tasks.register<Jar>("fatJar") {
386386
dependsOn(configurations.runtimeClasspath)
387387
dependsOn("createDynamicProperties")
388388

389-
archiveFileName.set("fat.jar")
389+
archiveFileName.set("astra-fat.jar")
390390
archiveVersion.set(project.version.toString())
391391

392392
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

scripts/dev-alias.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
alias astra='./gradlew -q fatJar && java --enable-native-access=ALL-UNNAMED -jar build/libs/fat.jar'
1+
alias astra='./gradlew -q fatJar && java --enable-native-access=ALL-UNNAMED -jar build/libs/astra-fat.jar'

0 commit comments

Comments
 (0)