Skip to content

Commit

Permalink
feat: Cross-compile and release for intel and arm architectures (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelsen authored Sep 19, 2024
1 parent 3507172 commit 46d1485
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
machine: [ubuntu-latest, self-hosted-arm64]
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
Expand All @@ -25,21 +28,24 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev
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
chmod +x ./slack-notifier-cli
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
path: slack-notifier-cli
change-log:
runs-on: ubuntu-latest
name: slack-notifier-cli-${{ runner.arch }}
path: slack-notifier-cli-${{ runner.arch }}
publish:
strategy:
matrix:
machine: [ubuntu-latest, self-hosted-arm64]
runs-on: ${{ matrix.machine }}
needs: build
timeout-minutes: 5
steps:
Expand All @@ -58,15 +64,15 @@ jobs:
output: "console"
slack-token: ${{ secrets.SLACK_APP_TOKEN }}
slack-channel: "#releases"
- name: Download a single artifact
- name: Download executable
uses: actions/download-artifact@v4
with:
name: slack-notifier-cli
- name: Upload binaries to release
name: slack-notifier-cli-${{ runner.arch }}
- name: Publish executable as release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: slack-notifier-cli
asset_name: slack-notifier-cli
file: slack-notifier-cli-${{ runner.arch }}
asset_name: slack-notifier-cli-${{ runner.arch }}
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 46d1485

Please sign in to comment.