Skip to content

Commit

Permalink
Build native image in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
2m committed Aug 22, 2021
1 parent c6d0552 commit 3b75373
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Native Image

on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
release:
types: [published]

jobs:
unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
include:
- os: macOS-latest
uploaded_filename: kabrioletas-x86_64-apple-darwin
local_path: target/native-image/kabrioletas
- os: ubuntu-latest
uploaded_filename: kabrioletas-x86_64-pc-linux
local_path: target/native-image/kabrioletas
- os: windows-latest
uploaded_filename: kabrioletas-x86_64-pc-win32.exe
local_path: target\native-image\kabrioletas.exe
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v11
- run: git fetch --tags || true
- shell: bash
if: ${{ matrix.os != 'windows-latest' }}
run: sbt kabrioletas/nativeImage
- shell: cmd
if: ${{ matrix.os == 'windows-latest' }}
run: >-
"C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt
kabrioletas/nativeImage
- uses: actions/upload-artifact@v2
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}
- name: Upload release
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.local_path }}
asset_name: ${{ matrix.uploaded_filename }}
asset_content_type: application/zip

0 comments on commit 3b75373

Please sign in to comment.