Merge pull request #7 from basicer/zig-win #47
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: Zig C++ Linux AMD64 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
permissions: | |
contents: write | |
actions: write | |
runs-on: ubuntu-24.04 | |
env: | |
CC: zig cc -target riscv64-linux-musl | |
CXX: zig c++ -target riscv64-linux-musl | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y git cmake zip wget xz-utils | |
git submodule update --init --recursive --depth=1 | |
# Install Zig | |
wget https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.2414+ba37a4369.tar.xz | |
tar -xf zig-linux-x86_64-0.14.0-dev.2414+ba37a4369.tar.xz | |
- name: Build all examples | |
working-directory: ${{github.workspace}} | |
run: | | |
export PATH=$PWD/zig-linux-x86_64-0.14.0-dev.2414+ba37a4369:$PATH | |
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSTRIPPED=ON | |
cmake --build build --parallel 8 | |
- name: Delete draft release(s) | |
uses: hugo19941994/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive | |
shell: sh | |
run: | | |
cd build/bin | |
for i in *; do | |
mv $i $i.elf; | |
zip -r "${i}.zip" $i.elf; | |
done | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Examples Nightly | |
files: | | |
build/bin/*.zip | |
generate_release_notes: true | |
draft: true | |
prerelease: true | |
fail_on_unmatched_files: true |