WIP: Rewrite #190
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
build-cli: | ||
strategy: | ||
matrix: | ||
include: | ||
- arch: linux-amd64 | ||
runs-on: ubuntu-latest | ||
- arch: linux-arm64 | ||
runs-on: arm-c8 | ||
- arch: macos-amd64 | ||
runs-on: macos-latest | ||
- arch: macos-arm64 | ||
runs-on: macos-latest-xlarge | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch Tags | ||
run: git fetch --tags origin | ||
- name: Setup Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Kmono CI" | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
cache: 'maven' | ||
cache-dependency-path: '**/deps.edn' | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: '21' | ||
distribution: 'graalvm' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: extractions/setup-just@v1 | ||
- uses: DeLaGuardo/[email protected] | ||
with: | ||
cli: latest | ||
- name: Preload dependencies | ||
run: | | ||
just cli cp -P ':*/*' > /dev/null | ||
- name: Build | ||
run: | | ||
just build | ||
just build-cli | ||
- name: Pack binary | ||
run: | | ||
tar -czf kmono-${{ matrix.arch }}.tar.gz -C ./target/bin kmono | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
if-no-files-found: error | ||
path: kmono-${{ matrix.arch }}.tar.gz | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download Binary Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: binaries | ||
path: bin | ||
- name: Calculate checksums | ||
run: | | ||
for file in bin/*; do | ||
shasum -a 256 "$file" >> checksums.txt | ||
done | ||
mv checksums.txt bin/checksums.txt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
bin/* |