Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: speed-up the workflow by uploading and downloading the shadowJars instead of regerating them #3079

Merged
merged 6 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 35 additions & 13 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ windows-2022, macos-12, ubuntu-22.04 ]
os: [ windows-2022, macos-12]
generateJars: [false]
include:
- os: ubuntu-22.04
generateJars: true
runs-on: ${{ matrix.os }}
timeout-minutes: 180
concurrency:
Expand Down Expand Up @@ -65,6 +69,16 @@ jobs:
name: installer-package-${{ runner.os }}
path: build/package/*
if-no-files-found: error
- name: Generate jars
if: ${{ matrix.generateJars }}
Zimbrando marked this conversation as resolved.
Show resolved Hide resolved
run: ./gradlew shadowJar
- name: Upload FatJars
if: ${{ matrix.generateJars }}
uses: actions/[email protected]
with:
name: fat-jars
path: build/shadow/*
if-no-files-found: error
# Performs a dry-deployment if credentials are available
test-deploy:
needs:
Expand Down Expand Up @@ -97,10 +111,11 @@ jobs:
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
# Test jpackage utility
test-packaging:
# Test packages correctness
test-packages:
needs:
- select-java-version
- build
strategy:
matrix:
os: [ windows-2022, macos-12, ubuntu-22.04 ]
Expand All @@ -119,16 +134,18 @@ jobs:
with:
java-version: ${{ needs.select-java-version.outputs.java-version }}
distribution: 'temurin'
- name: Dry run
shell: bash
run: ./gradlew jpackage --info -Djpackage.dryRun=true
- name: Install bsdtar
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install libarchive-tools
- name: Test packaging
- name: Download packages
uses: actions/[email protected]
with:
name: installer-package-${{ runner.os }}
path: build/package/
merge-multiple: true
- name: Test package
shell: bash
run: ./gradlew testJpackageOutput --info

run: ./gradlew testJpackageOutput --info
# Builds the website and verifies link sanity
build-website:
needs:
Expand Down Expand Up @@ -206,7 +223,7 @@ jobs:
- build
- build-website
- test-deploy
- test-packaging
- test-packages
runs-on: ubuntu-22.04
if: >-
!github.event.repository.fork
Expand Down Expand Up @@ -236,8 +253,14 @@ jobs:
- name: Download packages
uses: actions/[email protected]
with:
path: build/package/
pattern: installer-package-*
path: build/package/
merge-multiple: true
- name: Download fatJars
uses: actions/[email protected]
with:
name: fat-jars
path: build/shadow/
merge-multiple: true
- name: Find the version of Node from package.json
id: node-version
Expand Down Expand Up @@ -272,7 +295,6 @@ jobs:
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
#Add a step to publish to AUR

success:
runs-on: ubuntu-22.04
Expand All @@ -281,7 +303,7 @@ jobs:
- build-website
- release
- test-deploy
- test-packaging
- test-packages
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
Expand Down
2 changes: 1 addition & 1 deletion alchemist-full/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ tasks.register<Exec>("testJpackageOutput") {
require(rootProject.name in execFiles || "${rootProject.name}.exe" in execFiles)
require(jpackageFull.get().mainJar in appFiles)
}
dependsOn(jpackageFull)
mustRunAfter(jpackageFull)
finalizedBy(deleteJpackageOutput)
}

Expand Down
1 change: 0 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ git push --force origin \${nextRelease.version} || exit 6
git -C build/website/ add . || exit 1
git -C build/website/ commit -m "chore: update website to version \${nextRelease.version}" || exit 2
git -C build/website/ push || exit 3
./gradlew shadowJar --parallel || ./gradlew shadowJar --parallel || exit 4
RELEASE_ON_CENTRAL="./gradlew uploadKotlinOSSRH uploadKotlinMultiplatform uploadJvm uploadJs release --parallel"
eval "$RELEASE_ON_CENTRAL" || eval "$RELEASE_ON_CENTRAL" || eval "$RELEASE_ON_CENTRAL" || exit 5
./gradlew publishKotlinOSSRHPublicationToGithubRepository --continue || true
Expand Down
Loading