update gh action #10
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
on: | |
push | |
name: Build CLI 🧪 | |
jobs: | |
build: | |
name: "Build CLI for Windows and Linux" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
nim_version: | |
- '2.0.2' | |
env: | |
TIMEOUT_EXIT_STATUS: 124 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Cache nimble | |
id: cache-nimble | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: ${{ matrix.nim_version }} | |
- name: Install Dependencies 🔨 | |
run: | | |
sudo apt install mingw-w64 | |
- name: Windows build | |
run: | | |
cd src/ | |
nim c -d:danger -d:strip --cpu:amd64 -d:mingw --passC:-flto --passL:-flto --out:../bin/win/x64/elys.exe elys | |
nim c -d:danger -d:strip --cpu:i386 -d:mingw --passC:-flto --passL:-flto --out:../bin/win/x86/elys.exe elys | |
- name: Unix build | |
run: | | |
cd src/ | |
nim c -d:danger -d:strip --passC:-flto --passL:-flto --out:../bin/linux/x64/elys elys | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-x64 | |
path: | | |
bin/win/x64/elys.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-x86 | |
path: | | |
bin/win/x86/elys.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux-x64 | |
path: | | |
bin/linux/x64/elys |