Skip to content

Commit afa1b8b

Browse files
committed
repush
1 parent 79f8331 commit afa1b8b

File tree

1 file changed

+50
-40
lines changed

1 file changed

+50
-40
lines changed

.github/workflows/main.yml

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
tag_name: ${{ github.ref }}
4242
release_name: Release ${{ github.ref }}
4343

44-
windows_build:
44+
macos_build:
4545
needs: build
46-
runs-on: windows-latest
46+
runs-on: macOS-latest
4747

4848
steps:
4949
- name: Checkout code
@@ -54,43 +54,7 @@ jobs:
5454
with:
5555
name: ${{ env.FILE_NAME }}-jar-${{ env.VERSION }}
5656
path: ${{ env.OUT_DIR }}
57-
58-
- name: Setup Java 16
59-
uses: actions/setup-java@v2
60-
with:
61-
java-version: '16'
62-
distribution: 'temurin'
63-
64-
- name: Create Standalone for Windows
65-
run: jpackage --input ${{ env.OUT_DIR }} --name ${{ env.FILE_NAME }} --main-jar ${{ env.FILE_NAME }}-${{ env.VERSION }}.jar --main-class src.App --type exe --dest .
66-
67-
- name: List contents of out directory (Windows)
68-
run: Get-ChildItem -Path ${{ env.OUT_DIR }}
6957

70-
71-
- name: Rename Windows standalone
72-
run: move ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-${{ env.VERSION }}.jar ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
73-
74-
- name: Attach Windows Standalone to Release
75-
uses: actions/upload-release-asset@v1
76-
env:
77-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
with:
79-
upload_url: ${{ needs.build.outputs.release_upload_url }}
80-
asset_path: ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
81-
asset_name: ${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
82-
asset_content_type: application/octet-stream
83-
84-
macos_build:
85-
needs: build
86-
runs-on: macOS-latest
87-
88-
steps:
89-
- name: Checkout code
90-
uses: actions/checkout@v2
91-
92-
93-
9458
- name: Create Standalone for MacOS
9559
run: jpackage --input ${{ env.OUT_DIR }} --name ${{ env.FILE_NAME }} --main-jar ${{ env.FILE_NAME }}-${{ env.VERSION }}.jar --main-class src.App --type dmg --dest .
9660

@@ -118,8 +82,12 @@ jobs:
11882
- name: Checkout code
11983
uses: actions/checkout@v2
12084

121-
122-
85+
- name: Download JAR from artifact
86+
uses: actions/download-artifact@v2
87+
with:
88+
name: ${{ env.FILE_NAME }}-jar-${{ env.VERSION }}
89+
path: ${{ env.OUT_DIR }}
90+
12391
- name: Create Standalone for Ubuntu
12492
run: jpackage --input ${{ env.OUT_DIR }} --name ${{ env.FILE_NAME }} --main-jar ${{ env.FILE_NAME }}-${{ env.VERSION }}.jar --main-class src.App --type deb --dest .
12593

@@ -138,3 +106,45 @@ jobs:
138106
asset_path: ./${{ env.FILE_NAME }}-Ubuntu-${{ env.VERSION }}_amd64.deb
139107
asset_name: ${{ env.FILE_NAME }}-Ubuntu-${{ env.VERSION }}_amd64.deb
140108
asset_content_type: application/octet-stream
109+
110+
windows_build:
111+
needs: build
112+
runs-on: windows-latest
113+
114+
steps:
115+
- name: Checkout code
116+
uses: actions/checkout@v2
117+
118+
- name: Download JAR from artifact
119+
uses: actions/download-artifact@v2
120+
with:
121+
name: ${{ env.FILE_NAME }}-jar-${{ env.VERSION }}
122+
path: ${{ env.OUT_DIR }}
123+
124+
- name: Setup Java 16
125+
uses: actions/setup-java@v2
126+
with:
127+
java-version: '16'
128+
distribution: 'temurin'
129+
130+
- name: Create Standalone for Windows
131+
run: jpackage --input ${{ env.OUT_DIR }} --name ${{ env.FILE_NAME }} --main-jar ${{ env.FILE_NAME }}-${{ env.VERSION }}.jar --main-class src.App --type exe --dest .
132+
133+
- name: List contents of out directory (Windows)
134+
run: Get-ChildItem -Path ${{ env.OUT_DIR }}
135+
136+
137+
- name: Rename Windows standalone
138+
run: move ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-${{ env.VERSION }}.jar ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
139+
140+
- name: Attach Windows Standalone to Release
141+
uses: actions/upload-release-asset@v1
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
with:
145+
upload_url: ${{ needs.build.outputs.release_upload_url }}
146+
asset_path: ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
147+
asset_name: ${{ env.FILE_NAME }}-Windows-${{ env.VERSION }}.exe
148+
asset_content_type: application/octet-stream
149+
150+

0 commit comments

Comments
 (0)