@@ -11,16 +11,16 @@ jobs:
1111 runs-on : ubuntu-latest
1212 steps :
1313 - name : Checkout
14- uses : actions/checkout@v2.4.0
14+ uses : actions/checkout@v4
1515 - name : Setup JDK
16- uses : actions/setup-java@v2.5.0
16+ uses : actions/setup-java@v4
1717 with :
1818 distribution : temurin
1919 java-version : " 17"
2020 - name : Set execution flag for gradlew
2121 run : chmod +x gradlew
2222 - name : Setup Android SDK
23- uses : android-actions/setup-android@v2
23+ uses : android-actions/setup-android@v3
2424 - name : Install Android Build Tools
2525 run : sdkmanager "build-tools;29.0.3"
2626 - name : Run common unit tests
@@ -48,21 +48,121 @@ jobs:
4848 name : cli-jar
4949 path : cli/build/libs/linuxcommandlibrary.jar
5050
51+ dmg :
52+ name : Generate DMG
53+ runs-on : macos-latest
54+ steps :
55+ - name : Checkout
56+ uses : actions/checkout@v4
57+ - name : Setup JDK
58+ uses : actions/setup-java@v4
59+ with :
60+ distribution : temurin
61+ java-version : " 17"
62+ - name : Set execution flag for gradlew
63+ run : chmod +x gradlew
64+ - name : Build DMG
65+ run : ./gradlew :desktopApp:packageDmg
66+ - name : Upload DMG Artifact
67+ uses : actions/upload-artifact@v4
68+ with :
69+ name : dmg
70+ path : desktopApp/build/compose/binaries/main/dmg/*.dmg
71+
72+ msi :
73+ name : Generate MSI
74+ runs-on : windows-latest
75+ steps :
76+ - name : Checkout
77+ uses : actions/checkout@v4
78+ - name : Setup JDK
79+ uses : actions/setup-java@v4
80+ with :
81+ distribution : temurin
82+ java-version : " 17"
83+ - name : Build MSI
84+ run : ./gradlew :desktopApp:packageMsi
85+ - name : Upload MSI Artifact
86+ uses : actions/upload-artifact@v4
87+ with :
88+ name : msi
89+ path : desktopApp/build/compose/binaries/main/msi/*.msi
90+
91+ deb :
92+ name : Generate DEB
93+ runs-on : ubuntu-latest
94+ steps :
95+ - name : Checkout
96+ uses : actions/checkout@v4
97+ - name : Setup JDK
98+ uses : actions/setup-java@v4
99+ with :
100+ distribution : temurin
101+ java-version : " 17"
102+ - name : Set execution flag for gradlew
103+ run : chmod +x gradlew
104+ - name : Build DEB
105+ run : ./gradlew :desktopApp:packageDeb
106+ - name : Upload DEB Artifact
107+ uses : actions/upload-artifact@v4
108+ with :
109+ name : deb
110+ path : desktopApp/build/compose/binaries/main/deb/*.deb
111+
51112 release :
52- name : Release APK and JAR
53- needs : apk
113+ name : Release All Platforms
114+ needs : [ apk, dmg, msi, deb]
54115 runs-on : ubuntu-latest
55116 steps :
56117 - name : Checkout
57- uses : actions/checkout@v2.4.0
118+ uses : actions/checkout@v4
58119 - name : Download APK Artifact
59- uses : actions/download-artifact@v4.1.7
120+ uses : actions/download-artifact@v4
60121 with :
61122 name : signed-apk
123+ path : artifacts/apk
62124 - name : Download JAR Artifact
63- uses : actions/download-artifact@v4.1.7
125+ uses : actions/download-artifact@v4
64126 with :
65127 name : cli-jar
128+ path : artifacts/jar
129+ - name : Download DMG Artifact
130+ uses : actions/download-artifact@v4
131+ with :
132+ name : dmg
133+ path : artifacts/dmg
134+ - name : Download MSI Artifact
135+ uses : actions/download-artifact@v4
136+ with :
137+ name : msi
138+ path : artifacts/msi
139+ - name : Download DEB Artifact
140+ uses : actions/download-artifact@v4
141+ with :
142+ name : deb
143+ path : artifacts/deb
144+ - name : Extract version and rename assets
145+ run : |
146+ VERSION=${GITHUB_REF_NAME#v}
147+ echo "VERSION=$VERSION" >> $GITHUB_ENV
148+
149+ # Rename APK
150+ mv artifacts/apk/android-release-unsigned-signed.apk artifacts/LinuxCommandLibrary-${VERSION}-android.apk
151+
152+ # Rename JAR
153+ mv artifacts/jar/linuxcommandlibrary.jar artifacts/linuxcommandlibrary-${VERSION}.jar
154+
155+ # Rename DMG (find the actual file)
156+ DMG_FILE=$(find artifacts/dmg -name "*.dmg" | head -1)
157+ mv "$DMG_FILE" artifacts/LinuxCommandLibrary-${VERSION}-macos.dmg
158+
159+ # Rename MSI (find the actual file)
160+ MSI_FILE=$(find artifacts/msi -name "*.msi" | head -1)
161+ mv "$MSI_FILE" artifacts/LinuxCommandLibrary-${VERSION}-windows.msi
162+
163+ # Rename DEB (find the actual file)
164+ DEB_FILE=$(find artifacts/deb -name "*.deb" | head -1)
165+ mv "$DEB_FILE" artifacts/LinuxCommandLibrary-${VERSION}-linux.deb
66166 - name : Create Github Release
67167 id : create_release
68168 uses : actions/create-release@v1
@@ -72,22 +172,47 @@ jobs:
72172 tag_name : ${{ github.ref }}
73173 release_name : Release ${{ github.ref }}
74174 - name : Upload APK to Github Release
75- id : upload_apk
76175 uses : actions/upload-release-asset@v1.0.1
77176 env :
78177 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79178 with :
80179 upload_url : ${{ steps.create_release.outputs.upload_url }}
81- asset_path : android-release-unsigned-signed .apk
82- asset_name : LinuxCommandLibrary.apk
83- asset_content_type : application/zip
180+ asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-android .apk
181+ asset_name : LinuxCommandLibrary-${{ env.VERSION }}-android .apk
182+ asset_content_type : application/vnd.android.package-archive
84183 - name : Upload JAR to Github Release
85- id : upload_jar
86184 uses : actions/upload-release-asset@v1.0.1
87185 env :
88186 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89187 with :
90188 upload_url : ${{ steps.create_release.outputs.upload_url }}
91- asset_path : linuxcommandlibrary.jar
92- asset_name : linuxcommandlibrary.jar
93- asset_content_type : application/zip
189+ asset_path : artifacts/linuxcommandlibrary-${{ env.VERSION }}.jar
190+ asset_name : linuxcommandlibrary-${{ env.VERSION }}.jar
191+ asset_content_type : application/java-archive
192+ - name : Upload DMG to Github Release
193+ uses : actions/upload-release-asset@v1.0.1
194+ env :
195+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
196+ with :
197+ upload_url : ${{ steps.create_release.outputs.upload_url }}
198+ asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-macos.dmg
199+ asset_name : LinuxCommandLibrary-${{ env.VERSION }}-macos.dmg
200+ asset_content_type : application/x-apple-diskimage
201+ - name : Upload MSI to Github Release
202+ uses : actions/upload-release-asset@v1.0.1
203+ env :
204+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
205+ with :
206+ upload_url : ${{ steps.create_release.outputs.upload_url }}
207+ asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-windows.msi
208+ asset_name : LinuxCommandLibrary-${{ env.VERSION }}-windows.msi
209+ asset_content_type : application/x-msi
210+ - name : Upload DEB to Github Release
211+ uses : actions/upload-release-asset@v1.0.1
212+ env :
213+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
214+ with :
215+ upload_url : ${{ steps.create_release.outputs.upload_url }}
216+ asset_path : artifacts/LinuxCommandLibrary-${{ env.VERSION }}-linux.deb
217+ asset_name : LinuxCommandLibrary-${{ env.VERSION }}-linux.deb
218+ asset_content_type : application/vnd.debian.binary-package
0 commit comments