Skip to content

Commit

Permalink
Merge pull request #4 from MarvinKlar/master
Browse files Browse the repository at this point in the history
Add build and release workflow
  • Loading branch information
Bios-Marcel authored Jul 6, 2024
2 parents c41be98 + fffcba3 commit 2ed9792
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on: push

jobs:
test-and-build:
strategy:
matrix:
include:
- platform: windows-latest
binary_name: Baka-*.exe
output_name: Baka.exe

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '22'
distribution: 'adopt'

- name: Build artifact
shell: bash
run: |
./mvnw compile javafx:jlink jpackage:jpackage
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output_name }}
path: ./target/dist/${{ matrix.binary_name }}
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish release

on:
workflow_run:
workflows: [Build]
branches: [v**]
types: [completed]

jobs:
publish-release:
runs-on: ubuntu-latest
# Kinda bad since it might release on any branch starting with v, but it'll do for now.
# Tag filtering in "on:" doesn't work, since the inital build trigger gets lost.
# github.ref is therefore also being reset to "refs/head/master".
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Download windows artifact
uses: dawidd6/action-download-artifact@v3
with:
workflow: build.yml
name: Baka.exe

- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.event.workflow_run.head_branch }}
tag_name: ${{ github.event.workflow_run.head_branch }}
files: |
Baka.exe
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>link.bios-marcel</groupId>
<artifactId>baka</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.1.0</version>
<name>baka</name>

<properties>
Expand Down Expand Up @@ -118,7 +118,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>22</source>
<target>22</target>
Expand All @@ -130,7 +130,6 @@
<version>1.6.5</version>
<configuration>
<name>Baka</name>
<appVersion>1.0.0</appVersion>
<vendor>link.biosmarcel</vendor>
<destination>target/dist</destination>
<module>${mainModule}/${mainClass}</module>
Expand Down

0 comments on commit 2ed9792

Please sign in to comment.