build: respect PROTOC env var #35
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: Build on push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-dummy: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the dummy | |
working-directory: dummy-service | |
run: gcc -o GalaxyCommunication.exe main.c -ladvapi32 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dummy-GalaxyCommunication.exe | |
path: dummy-service/GalaxyCommunication.exe | |
build: | |
strategy: | |
matrix: | |
target: | |
[ | |
x86_64-unknown-linux-gnu, | |
aarch64-unknown-linux-gnu, | |
x86_64-apple-darwin, | |
aarch64-apple-darwin, | |
x86_64-pc-windows-msvc, | |
aarch64-pc-windows-msvc, | |
] | |
runs-on: ${{ (contains(matrix.target, 'apple-darwin') && 'macos-latest') || | |
(contains(matrix.target, 'linux-gnu') && 'ubuntu-latest') || | |
(contains(matrix.target, 'pc-windows') && 'windows-latest') }} | |
needs: build-dummy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
name: Install arm gcc | |
run: sudo apt install gcc-aarch64-linux-gnu | |
- name: Setup target | |
run: rustup target add ${{ matrix.target }} | |
- name: Build | |
run: cargo build --verbose --release --target ${{ matrix.target }} | |
- name: Downloading dummy service for packaging | |
uses: actions/download-artifact@v4 | |
with: | |
name: dummy-GalaxyCommunication.exe | |
path: dummy-service | |
- name: Generic packaging | |
uses: actions/upload-artifact@v4 | |
with: | |
name: comet-${{ matrix.target }} | |
path: | | |
target/${{ matrix.target }}/release/comet* | |
!target/${{ matrix.target }}/release/comet.d | |
dummy-service/ | |
!dummy-service/*.c | |
${{ contains(matrix.target, 'linux-gnu') && 'docs/steamdeck' }} |