diff options
Diffstat (limited to '.github/workflows/build_netbsd.yml')
-rw-r--r-- | .github/workflows/build_netbsd.yml | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/.github/workflows/build_netbsd.yml b/.github/workflows/build_netbsd.yml new file mode 100644 index 0000000..e169ea3 --- /dev/null +++ b/.github/workflows/build_netbsd.yml @@ -0,0 +1,61 @@ +name: Build latest (NetBSD) +# trigger via either push to selected branches or on manual run +on: + push: + branches: + - main + - master + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-netbsd + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ghcr.io/cross-rs/x86_64-unknown-netbsd:edge + steps: + - uses: actions/checkout@v3 + - name: Install prerequisites + run: apt install wget unzip + - name: Retrieve OpenGL and X11 dev files (64 bit) + run: | + mkdir src/netbsd64 + cd src/netbsd64 + wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/netbsd64.zip + unzip netbsd64.zip + - name: Compile NetBSD builds + id: compile + shell: bash + env: + COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn" + PLAT64_FLAGS: "-fno-pie -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON -I netbsd64/include -L netbsd64/lib -Wl,--unresolved-symbols=ignore-in-shared-libs" + run: | + LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\" + echo $LATEST_FLAG + + cd src + x86_64-unknown-netbsd-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.PLAT64_FLAGS }} $LATEST_FLAG -o cc-netbsd64-gl1 -lm -lpthread -lX11 -lXi -lGL -lexecinfo + + + - uses: ./.github/actions/notify_failure + if: ${{ always() && steps.compile.outcome == 'failure' }} + with: + NOTIFY_MESSAGE: 'Failed to compile NetBSD build(s)' + WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}' + + + - uses: ./.github/actions/upload_build + if: ${{ always() && steps.compile.outcome == 'success' }} + with: + SOURCE_FILE: 'src/cc-netbsd64-gl1' + DEST_NAME: 'ClassiCube-NetBSD-64' + + + - uses: ./.github/actions/notify_success + if: ${{ always() && steps.compile.outcome == 'success' }} + with: + DESTINATION_URL: '${{ secrets.NOTIFY_URL }}' + WORKFLOW_NAME: 'netbsd' \ No newline at end of file |