Skip to content

Commit db021c1

Browse files
committed
Split workflow
1 parent f2c2427 commit db021c1

2 files changed

Lines changed: 55 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# against bad commits.
55

66
name: build
7-
on: [pull_request, push]
7+
on: [workflow_dispatch]
88

99
jobs:
1010
build:
@@ -23,16 +23,6 @@ jobs:
2323
run: chmod +x ./gradlew
2424
- name: Build with Gradle
2525
run: ./gradlew build
26-
- name: Download Launch4j
27-
run: |
28-
curl https://jaist.dl.sourceforge.net/project/launch4j/launch4j-3/3.50/launch4j-3.50-linux-x64.tgz -o launch4j.tgz
29-
tar -xzvf launch4j.tgz
30-
31-
- name: Run Launch4j
32-
run: |
33-
cd assets/launch4j
34-
java -jar $GITHUB_WORKSPACE/launch4j/launch4j.jar launch4j.xml
35-
cp PW-GUI.exe $GITHUB_WORKSPACE/build/libs/
3626
- name: Upload Artifacts to GitHub
3727
uses: actions/upload-artifact@v4
3828
with:

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Automatically build the project and run any configured tests for every push
2+
# and submitted pull request. This can help catch issues that only occur on
3+
# certain platforms or Java versions, and provides a first line of defence
4+
# against bad commits.
5+
6+
# Adopted from https://github.com/ModFest/glowcase/blob/1.21/.github/workflows/release.yml
7+
8+
name: Release Build
9+
on: [pull_request, push]
10+
11+
on:
12+
release:
13+
types:
14+
- published
15+
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Set up JDK
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: 'temurin'
30+
java-version: 17
31+
- name: Validate gradle wrapper
32+
uses: gradle/actions/wrapper-validation@v4
33+
- name: Make Gradle wrapper executable
34+
run: chmod +x ./gradlew
35+
- name: Build with Gradle
36+
run: ./gradlew build
37+
- name: Download Launch4j
38+
run: |
39+
curl https://jaist.dl.sourceforge.net/project/launch4j/launch4j-3/3.50/launch4j-3.50-linux-x64.tgz -o launch4j.tgz
40+
tar -xzvf launch4j.tgz
41+
- name: Run Launch4j
42+
run: |
43+
cd assets/launch4j
44+
java -jar $GITHUB_WORKSPACE/launch4j/launch4j.jar launch4j.xml
45+
cp PW-GUI.exe $GITHUB_WORKSPACE/build/libs/
46+
- name: Generate artifact attestation
47+
uses: actions/attest-build-provenance@v2
48+
with:
49+
subject-path: 'build/libs/*-all.jar, build/libs/*.exe'
50+
- name: Upload GitHub release
51+
uses: AButler/upload-release-assets@v2.0
52+
with:
53+
files: 'build/libs/*-all.jar;build/libs/*.exe'
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)