Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directly upload Mac / Windows executables. #93

Merged
merged 27 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7689203
Add bin task to Gradle.
heeheehee-kolmafia Oct 5, 2021
08aa16c
Copy-paste build to run ./gradlew bin.
heeheehee-kolmafia Oct 5, 2021
13fa65c
Run build for the jpackage branch.
heeheehee-kolmafia Oct 5, 2021
1685926
List created artifacts.
heeheehee-kolmafia Oct 5, 2021
09c6e49
Inspect parent directory.
heeheehee-kolmafia Oct 5, 2021
16b7a19
Install binaries into dist/.
heeheehee-kolmafia Oct 5, 2021
288ec30
Move files back into build/.
heeheehee-kolmafia Oct 5, 2021
f0d3f9a
Upload all artifacts, then download them.
heeheehee-kolmafia Oct 5, 2021
d80c89e
Add name, runs-on to release job.
heeheehee-kolmafia Oct 5, 2021
dc41fee
Bundle artifacts as zips.
heeheehee-kolmafia Oct 5, 2021
7632aec
M-x untabify
heeheehee-kolmafia Oct 5, 2021
9fcaf5c
Move code into build/releases, stop using wildcard.
heeheehee-kolmafia Oct 5, 2021
c3d27f4
Stitch everything together.
heeheehee-kolmafia Oct 5, 2021
17b1c2f
Remove extra newline.
heeheehee-kolmafia Oct 5, 2021
8f440ae
Use jpackage-gradle-plugin instead of exec task.
heeheehee-kolmafia Oct 5, 2021
c78f9a0
Improve portability of jpackage task.
heeheehee-kolmafia Oct 5, 2021
8737dfa
added appVersion, mac and windows package types, and mac icon
BadHorseMonkey Oct 6, 2021
54a72b3
Merge branch 'main' into jpackage
heeheehee-kolmafia Oct 6, 2021
f33d2c8
Add Windows icon for binary release.
heeheehee-kolmafia Oct 6, 2021
16a22f9
Directly upload Mac, Windows executables.
heeheehee-kolmafia Oct 6, 2021
3ce4f7f
Merge branch 'kolmafia:main' into jpackage
heeheehee-kolmafia Oct 6, 2021
dab1b26
Merge remote-tracking branch 'origin/jpackage' into jpackage
BadHorseMonkey Oct 6, 2021
0b273fb
Try to target deb or rpm on Linux if available.
heeheehee-kolmafia Oct 6, 2021
ae73f15
Add revision info to appName, appVersion.
heeheehee-kolmafia Oct 6, 2021
3fddcae
Merge remote-tracking branch 'origin/jpackage' into jpackage
BadHorseMonkey Oct 7, 2021
37540e8
This change adds the Windows DirChooser, Shortcut, and useCWDasROOT f…
BadHorseMonkey Oct 7, 2021
33c6a29
set to upload mac DMGs
BadHorseMonkey Oct 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ jobs:
ORG_GRADLE_PROJECT_commit: ${{ github.sha }}
run: ./gradlew --no-daemon jpackage

- name: Zip binaries
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: '${{runner.os}}.zip'
directory: 'build/releases/'

- name: Upload zipballs
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: releases
path: build/releases/*.zip
path: |
build/releases/*.deb
build/releases/*.exe
build/releases/*.dmg

jar:
if: github.repository == 'kolmafia/kolmafia'
Expand Down Expand Up @@ -104,7 +100,9 @@ jobs:
with:
files: |
dist/*.jar
releases/*.zip
releases/*.deb
releases/*.exe
releases/*.dmg
tag_name: r${{ env.KOLMAFIA_VERSION }}
name: ${{ env.KOLMAFIA_VERSION }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an "r" prefix here too? Or even "Revision " or "Release "

env:
Expand Down
52 changes: 42 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '6.0.0'
id 'net.nemerosa.versioning' version '2.8.2'
id 'org.ajoberstar.grgit' version '4.1.0'
id "org.panteleyev.jpackageplugin" version "1.3.1"
id 'org.panteleyev.jpackageplugin' version '1.3.1'
}
mainClassName = 'net.sourceforge.kolmafia.KoLmafia'

Expand Down Expand Up @@ -178,7 +178,7 @@ jar {
}
duplicatesStrategy = 'exclude'
destinationDirectory = file('dist/')
archiveBaseName.set("KoLmafia")
archiveBaseName.set('KoLmafia')
archiveClassifier.set("${versioning.info.dirty ? 'M' : ''}")
}

Expand All @@ -192,7 +192,7 @@ task getRevision() {
onlyIf {
file('.git').exists()
}
def commit = findProperty("commit") ?: 'origin/main'
def commit = findProperty('commit') ?: 'origin/main'
inputs.dir('.git')
inputs.property('commit', commit)
outputs.files file('build/revision.txt')
Expand All @@ -217,15 +217,15 @@ task gitUpdate() {
remote = remote
}
if (grgit.resolve.toCommit(remote) == latestHead) {
println "Already up-to-date, nothing to do."
println 'Already up-to-date, nothing to do.'
return
}
def dirty = versioning.info.dirty
if (dirty) {
// This pollutes the reflog, but there's no stash functionality in
// grgit...
grgit.commit {
message = "temporary stash commit"
message = 'temporary stash commit'
all = true
}
}
Expand Down Expand Up @@ -262,20 +262,52 @@ tasks.jpackage {
input = 'dist'
destination = 'build/releases'
mainClass = mainClassName
appVersion = new Date().format("yy.MM")
appVersion = new Date().format('yy.MM')
linux {
type = 'APP_IMAGE'
icon = 'util/linux/KoLmafia.ico'
}
mac {
type = 'pkg'
type = 'dmg'
icon = 'util/macosx/limeglass.icns'

}
windows{
type = 'exe'
icon = 'util/windows/KoLmelion.ico'
icon = 'util/windows/KoLmafia.ico'
heeheehee-kolmafia marked this conversation as resolved.
Show resolved Hide resolved
winShortcut = 'true'
winDirChooser = 'true'
javaOptions = ["-DuseCWDasROOT=true"]
}
doFirst {
mainJar = tasks.shadowJar.archiveFileName.get()
appVersion += '.' + version
appName = 'KoLmafia-r' + version + "${versioning.info.dirty ? 'M' : ''}"
println 'Packaging app ' + appName + '...'
if (System.properties['os.name'] != 'Linux') {
return
}
def hasDeb = exec {
ignoreExitValue = true
errorOutput = OutputStream.nullOutputStream()
executable 'bash'
args '-c', 'which dpkg-deb'
}
def hasRpm = exec {
ignoreExitValue = true
errorOutput = OutputStream.nullOutputStream()
executable 'bash'
args '-c', 'which rpmbuild'
}
if (hasDeb.getExitValue() == 0) {
println 'Targeting deb for jpackage...'
linux { type = 'deb' }
} else if (hasRpm.getExitValue() == 0) {
println 'Targeting rpm for jpackage...'
linux { type = 'rpm' }
} else {
println 'Bundling all files for jpackage.'
linux { type = 'app-image' }
}
}
}

Expand All @@ -290,7 +322,7 @@ jacocoTestReport.dependsOn test

def lastRevision() {
def revisionFile = file('build/revision.txt')
return revisionFile.exists() ? revisionFile.text.trim() : "0"
return revisionFile.exists() ? revisionFile.text.trim() : '0'
}

// Set version from last build/revision.txt if up-to-date
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAME
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

javaSourceCompatibility=9
javaTargetCompatibility=9
javaSourceCompatibility=11
javaTargetCompatibility=11
202 changes: 0 additions & 202 deletions util/debian/ant-deb.LICENSE

This file was deleted.

Binary file removed util/debian/ant-deb.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions util/debian/kol

This file was deleted.