Skip to content

Commit

Permalink
Build arm on intel
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelsen committed Sep 19, 2024
1 parent 46d1485 commit 4eef2be
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 79 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build binary

on:
push:

jobs:
build:
strategy:
matrix:
machine: [ubuntu-latest, self-hosted-arm64]
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- uses: actions/cache@v4
with:
path: "/home/runner/.konan"
key: ${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install libcurl4-openssl-dev
- name: Build with Gradle
run: ./gradlew commonBinaries
- name: Move and apply correct permissions to binary
run: |
cp build/bin/common/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-${{ runner.arch }}
chmod +x ./slack-notifier-cli-${{ runner.arch }}
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: slack-notifier-cli-${{ runner.arch }}
path: slack-notifier-cli-${{ runner.arch }}
78 changes: 0 additions & 78 deletions .github/workflows/publish.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin {
val commonTarget = when {
hostOs == "Mac OS X" -> macosArm64("common")
hostOs == "Linux" && hostArch == "aarch64" -> linuxArm64("common")
hostOs == "Linux" && hostArch == "amd64" -> linuxX64("common")
hostOs == "Linux" && hostArch == "amd64" -> linuxArm64("common")
hostOs.startsWith("Windows") -> mingwX64("common")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
Expand Down

0 comments on commit 4eef2be

Please sign in to comment.