Skip to content

Commit 6d3b7d4

Browse files
committed
App Store upload & Snap fix
[skip ci]
1 parent 55d616b commit 6d3b7d4

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

.github/workflows/release-gradle.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,17 @@ jobs:
169169
if: runner.os == 'Linux'
170170
run: snapcraft upload app/build/compose/binaries/main/${{ matrix.binary }}.${{ matrix.extension }}
171171
env:
172-
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.PROCESSING_SNAPCRAFT_TOKEN }}
172+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.PROCESSING_SNAPCRAFT_TOKEN }}
173+
174+
- name: Upload pkg to App Store
175+
if: runner.os == 'macOS'
176+
run: xcrun altool \
177+
--upload-package app/build/compose/binaries/main/pkg/Processing-${{ needs.version.outputs.version }}.pkg \
178+
--type macos \
179+
--asc-public-id ${{ secrets.PROCESSING_STORE_PUBLIC_ID }} \
180+
--apple-id ${{ secrets.PROCESSING_STORE_APP_ID }} \
181+
--bundle-id ${{ vars.GRADLE_GROUP }}.app \
182+
--bundle-short-version-string ${{ needs.version.outputs.version }} \
183+
--bundle-version ${{ needs.version.outputs.version }} \
184+
--username ${{ secrets.PROCESSING_APPLE_ID }} \
185+
--password ${{ secrets.PROCESSING_APP_PASSWORD }}

app/build.gradle.kts

+22-8
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ compose.desktop {
5050

5151
nativeDistributions{
5252
modules("jdk.jdi", "java.compiler", "jdk.accessibility")
53-
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Pkg)
53+
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
5454
packageName = "Processing"
5555

5656
macOS{
@@ -162,6 +162,23 @@ tasks.register<Exec>("packageCustomDmg"){
162162
app
163163
)
164164
}
165+
tasks.register<Exec>("packagePkg"){
166+
onlyIf { org.gradle.internal.os.OperatingSystem.current().isMacOsX }
167+
dependsOn("createDistributable")
168+
group = "compose desktop"
169+
val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
170+
val app = distributable.destinationDir.get().file("${distributable.packageName.get()}.app").asFile
171+
val target = app.parentFile.parentFile.resolve("pkg/${distributable.packageName.get()}-$version.pkg")
172+
target.parentFile.mkdirs()
173+
174+
commandLine("pkgbuild",
175+
"--install-location", "/Applications",
176+
"--identifier", "${rootProject.group}.app",
177+
"--version", version,
178+
"--component", app,
179+
target
180+
)
181+
}
165182

166183
tasks.register<Exec>("packageCustomMsi"){
167184
onlyIf { org.gradle.internal.os.OperatingSystem.current().isWindows }
@@ -205,6 +222,8 @@ tasks.register("generateSnapConfiguration"){
205222
processing:
206223
command: opt/processing/bin/Processing
207224
desktop: opt/processing/lib/processing-Processing.desktop
225+
environment:
226+
LD_LIBRARY_PATH: ${'$'}SNAP/lib:${'$'}LD_LIBRARY_PATH
208227
plugs:
209228
- desktop
210229
- desktop-legacy
@@ -216,12 +235,9 @@ tasks.register("generateSnapConfiguration"){
216235
plugin: dump
217236
source: deb/processing_$version-1_$snaparch.deb
218237
source-type: deb
219-
stage-packages:
220-
- openjdk-17-jdk
221238
override-prime: |
222239
snapcraftctl prime
223240
chmod -R +x opt/processing/lib/app/resources/jdk-*
224-
rm -vf usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts
225241
""".trimIndent()
226242
dir.file("../snapcraft.yaml").asFile.writeText(content)
227243
}
@@ -249,14 +265,12 @@ tasks.register<Zip>("zipDistributable"){
249265
}
250266

251267
afterEvaluate{
252-
tasks.named("createDistributable").configure{
253-
finalizedBy("zipDistributable")
254-
}
255268
tasks.named("packageDmg").configure{
256269
dependsOn("packageCustomDmg")
257270
group = "compose desktop"
258271
actions = emptyList()
259272
}
273+
260274
tasks.named("packageMsi").configure{
261275
dependsOn("packageCustomMsi")
262276
group = "compose desktop"
@@ -268,7 +282,7 @@ afterEvaluate{
268282
){
269283
dependsOn("notarizeDmg")
270284
}
271-
dependsOn("packageSnap")
285+
dependsOn("packageSnap", "zipDistributable", "packagePkg")
272286
}
273287
}
274288

0 commit comments

Comments
 (0)