Skip to content

Commit

Permalink
Enforced x86_64 for MacOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
JetpackDuba committed Dec 4, 2024
1 parent 2a59fd1 commit 246daed
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 43 deletions.
80 changes: 41 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: aarch64-unknown-linux-gnu
- run: cargo install cargo-kotars --git https://github.com/JetpackDuba/kotars
- run: cargo install cross
- name: Set up JDK 17
Expand Down Expand Up @@ -124,42 +125,43 @@ jobs:
Output/Gitnuro*.zip
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

# build_macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: nightly
# - run: cargo install cargo-kotars --git https://github.com/JetpackDuba/kotars
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'corretto'
# architecture: x64
# - name: Build with Gradle
# uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
# with:
# arguments: createDistributable
# - name: Create output directory
# run: mkdir Output
# - name: MacOS DMG
# working-directory: build/compose/binaries/main/app/
# run: zip -r ../../../../../Output/Gitnuro_macos_${{github.ref_name}}.zip .
# - name: Generate SHA256 Checksum
# working-directory: ./Output/
# run: find . -type f -exec bash -c "shasum -a 256 {} > {}.sum " \;
# - name: Release
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# body: "Beta release"
# prerelease: true
# draft: true
# repository: JetpackDuba/Gitnuro
# with:
# files: |
# Output/Gitnuro*.zip
# Output/Gitnuro*.sum
# token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: x86_64-apple-darwin
- run: cargo install cargo-kotars --git https://github.com/JetpackDuba/kotars
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
architecture: x64
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: createDistributable
- name: Create output directory
run: mkdir Output
- name: MacOS DMG
working-directory: build/compose/binaries/main/app/
run: zip -r ../../../../../Output/Gitnuro_macos_${{github.ref_name}}.zip .
- name: Generate SHA256 Checksum
working-directory: ./Output/
run: find . -type f -exec bash -c "shasum -a 256 {} > {}.sum " \;
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body: "Beta release"
prerelease: true
draft: true
repository: JetpackDuba/Gitnuro
with:
files: |
Output/Gitnuro*.zip
Output/Gitnuro*.sum
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
12 changes: 8 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ repositories {
dependencies {
val jgit = "6.9.0.202403050737-r"

if (currentOs() == OS.LINUX && isLinuxAarch64) {
implementation(compose.desktop.linux_arm64)
} else {
implementation(compose.desktop.currentOs)
when {
currentOs() == OS.LINUX && isLinuxAarch64 -> implementation(compose.desktop.linux_arm64)
currentOs() == OS.MAC -> implementation(compose.desktop.macos_x64)
else -> implementation(compose.desktop.currentOs)
}

@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
Expand Down Expand Up @@ -261,6 +261,8 @@ fun buildRust() {
} else {
params.add("--target=$linuxX64Target")
}
} else if (currentOs() == OS.MAC) {
params.add("--target=x86_64-apple-darwin")
}

workingDir = File(project.projectDir, "rs")
Expand All @@ -283,6 +285,8 @@ fun copyRustBuild() {
} else {
"rs/target/$linuxX64Target/$buildTypeDirectory"
}
} else if (currentOs() == OS.MAC) {
"rs/target/x86_64-apple-darwin/$buildTypeDirectory"
} else {
"rs/target/$buildTypeDirectory"
}
Expand Down

0 comments on commit 246daed

Please sign in to comment.