-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
412bf80
commit 48a8fe4
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Based on: | ||
# https://forum.crystal-lang.org/t/the-easiest-way-to-prepare-a-ready-to-use-windows-executable-on-linux/7040/4 | ||
|
||
name: Crystal CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build_release: | ||
name: Build Release ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu, windows] | ||
runs-on: ${{ matrix.os }}-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Crystal | ||
uses: crystal-lang/install-crystal@v1 | ||
with: | ||
crystal: latest | ||
|
||
- name: Run Linux Build | ||
if: matrix.os == 'ubuntu' | ||
run: | | ||
mkdir -p bin | ||
chmod 755 bin | ||
docker run -d --name alpine -v $(pwd):/workspace -w /workspace crystallang/crystal:latest-alpine tail -f /dev/null | ||
docker exec alpine shards install --without-development --release --static | ||
docker exec alpine shards build --release --static | ||
docker exec alpine mv bin/parkedcar-gen bin/parkedcar-gen-linux | ||
- name: Run Windows Build x64 | ||
if: matrix.os == 'windows' | ||
run: | | ||
shards build --release --static | ||
Set-ExecutionPolicy RemoteSigned -Scope Process | ||
Rename-Item -Path bin/parkedcar-gen.exe -NewName parkedcar-gen-windows.exe | ||
- name: Upload Release Asset | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
bin/parkedcar-gen-linux | ||
bin/parkedcar-gen-windows.exe | ||
tag_name: rolling |