Skip to content

Commit

Permalink
* update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ptma committed Sep 20, 2023
1 parent 2114bb3 commit f7496ee
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,36 @@ jobs:
file_glob: true
body: ""

build-on-mac-m1:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew packageForMac_M1
- id: set_var
run: |
content=`cat ./assets/version.json`
echo "::set-output name=versionJson::$content"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.REPO_TOKEN }}
file: ./build/MqttInsight_${{fromJson(steps.set_var.outputs.versionJson).version}}.dmg
asset_name: MqttInsight_${{fromJson(steps.set_var.outputs.versionJson).version}}_M1.dmg
tag: ${{ github.ref }}
release_name: ${{ github.ref }}
overwrite: true
file_glob: false
body: ""

build-on-windows:
runs-on: windows-latest
steps:
Expand Down
9 changes: 6 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ buildscript {

plugins.apply("io.github.fvarrui.javapackager.plugin")

version = "1.0.1"

val appliactionVersion: String = "1.0.1"
val applicationName: String = "MqttInsight"
val organization: String = "ptma@163.com"
val copyright: String = "copyright 2023 ptma@163.com"
Expand Down Expand Up @@ -175,6 +174,7 @@ tasks.register<PackageTask>("packageForWindows") {

organizationName = organization
organizationUrl = supportUrl
version = appliactionVersion;

platform = Platform.windows
isCreateZipball = false
Expand Down Expand Up @@ -205,6 +205,7 @@ tasks.register<PackageTask>("packageForLinux") {

organizationName = organization
organizationUrl = supportUrl
version = appliactionVersion;

linuxConfig(
closureOf<LinuxConfig> {
Expand All @@ -225,6 +226,7 @@ tasks.register<PackageTask>("packageForMac_M1") {

organizationName = organization
organizationUrl = supportUrl
version = appliactionVersion;

macConfig(
closureOf<MacConfig> {
Expand All @@ -242,6 +244,7 @@ tasks.register<PackageTask>("packageForMac") {

organizationName = organization
organizationUrl = supportUrl
version = appliactionVersion;

macConfig(
closureOf<MacConfig> {
Expand All @@ -259,5 +262,5 @@ fun getIconFile(fileName: String): File {

fun updateVersion() {
val jsonFile = File(projectDir.absolutePath + File.separator + "assets" + File.separator + "version.json")
jsonFile.writeText("{\"version\": \"${version}\"}", Charset.forName("utf-8"))
jsonFile.writeText("{\"version\": \"${appliactionVersion}\"}", Charset.forName("utf-8"))
}

0 comments on commit f7496ee

Please sign in to comment.