Skip to content

Build Binaries

Build Binaries #55

Workflow file for this run

name: Build Binaries
defaults:
run:
shell: bash
on:
workflow_dispatch
jobs:
create_release:
name: Create Release
if: contains('["raub"]', github.actor)
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Fetch Repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.14.0
cache: 'npm'
- name: Get Package Version
id: package-version
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ steps.package-version.outputs.version }}
name: Release ${{ steps.package-version.outputs.version }}
body: Binaries at ${{ github.sha }}
build:
name: Build
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14, [self-hosted, linux, ARM64]]
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.14.0
cache: 'npm'
- name: Install Modules
run: npm ci --ignore-scripts
- name: Add msbuild to PATH
if: matrix.os == 'windows-2022'
uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: x64
- name: Build Pre Step
run: chmod +x src/extract.sh && src/extract.sh
- name: Build Unix
if: matrix.os != 'windows-2022'
run: node src/build-unix
- name: Build Windows GLEW
if: matrix.os == 'windows-2022'
shell: cmd
run: src/windows-glew.cmd
- name: Build Windows GLFW
if: matrix.os == 'windows-2022'
shell: cmd
run: src/windows-glfw.cmd
- name: Build Post Step
run: node src/build-post
- name: Get Package Version
id: package-version
shell: bash
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT
- name: Pack Files
id: pack-files
run: node -e "require('addon-tools-raub').actionPack()" >> $GITHUB_OUTPUT
- name: Store Binaries
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ steps.package-version.outputs.version }}
name: Release ${{ steps.package-version.outputs.version }}
files: ${{ steps.pack-files.outputs.pack }}