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

feat: Cross-compile and release for intel and arm architectures #73

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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