Skip to content

Commit

Permalink
First attempt to build releases for all OSes.
Browse files Browse the repository at this point in the history
Signed-off-by: Vest <[email protected]>
  • Loading branch information
Vest committed Feb 1, 2025
1 parent a03e8da commit cbe681d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 10 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Create Release

on:
pull_request:

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: false

build_release:
name: Build Release
needs: create_release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
release_suffix: ubuntu
- os: macos-latest
release_suffix: mac
- os: windows-latest
release_suffix: windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
cache-dependency-path: |
build.gradle
code/gradle/autobuild.gradle
code/gradle/distribution.gradle
code/gradle/release.gradle
code/gradle/reporting.gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-disabled: false
cache-read-only: false
cache-overwrite-existing: true

- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/jre
${{ github.workspace }}/build/libs
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ matrix.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
${{ matrix.os }}-gradle
- name: Build the image
if: success()
run: ./gradlew jpackage

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Release - matrix.os
path: ${{ github.workspace }}/build/jpackage

- name: Release - matrix.os
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
files: release_${{ matrix.release_suffix }}
10 changes: 0 additions & 10 deletions .github/workflows/gradle.yml → .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,3 @@ jobs:
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Build the image
if: success()
run: ./gradlew jpackage

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Release
path: ${{ github.workspace }}/build/jpackage

0 comments on commit cbe681d

Please sign in to comment.