Skip to content

Feature: infer parent/child relationships between games #1474

Feature: infer parent/child relationships between games

Feature: infer parent/child relationships between games #1474

Workflow file for this run

name: Compile Node.js
on:
pull_request:
types:
# - edited # PR's base branch was changed
- opened
- reopened
- synchronize # PR's branch was edited (i.e. new commits)
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
node-compile:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
include:
- os: ubuntu
build: |
NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')
NODE_ARCH=amd64
BIN_OUTPUT="igir-${NPM_PKG_VERSION}-${RUNNER_OS}-${NODE_ARCH/\//}.tar.gz"
echo "BIN_OUTPUT=${BIN_OUTPUT}" >> $GITHUB_ENV
cp package.json build/
docker run --rm --platform "linux/${NODE_ARCH}" --volume "$(pwd):/app" --workdir "/app" \
"node:$(cat .nvmrc)" sh -c \
"./node_modules/.bin/caxa --input build/ --output igir -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.js\" && ./igir --help"
tar cvf - igir | gzip --best > "${BIN_OUTPUT}"
- os: ubuntu
build: |
NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')
NODE_ARCH=arm/v7
BIN_OUTPUT="igir-${NPM_PKG_VERSION}-${RUNNER_OS}-${NODE_ARCH/\//}.tar.gz"
echo "BIN_OUTPUT=${BIN_OUTPUT}" >> $GITHUB_ENV
cp package.json build/
docker run --rm --platform "linux/${NODE_ARCH}" --volume "$(pwd):/app" --workdir "/app" \
"node:$(cat .nvmrc)" sh -c \
"./node_modules/.bin/caxa --input build/ --output igir -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.js\" && ./igir --help"
tar cvf - igir | gzip --best > "${BIN_OUTPUT}"
- os: ubuntu
build: |
NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')
NODE_ARCH=arm64/v8
BIN_OUTPUT="igir-${NPM_PKG_VERSION}-${RUNNER_OS}-${NODE_ARCH/\//}.tar.gz"
echo "BIN_OUTPUT=${BIN_OUTPUT}" >> $GITHUB_ENV
cp package.json build/
docker run --rm --platform "linux/${NODE_ARCH}" --volume "$(pwd):/app" --workdir "/app" \
"node:$(cat .nvmrc)" sh -c \
"./node_modules/.bin/caxa --input build/ --output igir -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.js\" && ./igir --help"
tar cvf - igir | gzip --best > "${BIN_OUTPUT}"
- os: macos
build: |
NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')
NODE_ARCH=$(node --print 'process.arch')
BIN_OUTPUT="igir-${NPM_PKG_VERSION}-${RUNNER_OS}-${NODE_ARCH}.tar.gz"
echo "BIN_OUTPUT=${BIN_OUTPUT}" >> $GITHUB_ENV
cp package.json build/
./node_modules/.bin/caxa --input build/ --output igir -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/index.js"
./igir --help
tar cvf - igir | gzip --best > "${BIN_OUTPUT}"
- os: windows
build: |
$NPM_PKG_VERSION=$(npm pkg get version).replace('"','')
$NODE_ARCH=$(node --print 'process.arch')
$BIN_OUTPUT="igir-$NPM_PKG_VERSION-${env:RUNNER_OS}-${NODE_ARCH}.zip"
echo "BIN_OUTPUT=${BIN_OUTPUT}" | Out-File -FilePath $env:GITHUB_ENV -Append # no need for -Encoding utf8
copy package.json build\
.\node_modules\.bin\caxa --input build\ --output igir.exe -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/index.js"
.\igir.exe --help
Compress-Archive -Path igir.exe -DestinationPath "${BIN_OUTPUT}" -CompressionLevel Optimal -Force
steps:
# Setup and install
- uses: actions/checkout@v3
- if: matrix.os == 'ubuntu'
uses: docker/setup-qemu-action@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build
# Compile and upload
- run: ${{ matrix.build }}
- run: echo ${{ env.BIN_OUTPUT }}
- if: github.event_name == 'release'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: ${{ env.BIN_OUTPUT }}
if-no-files-found: error
release-update:
if: github.event_name == 'release'
needs:
- node-compile
runs-on: ubuntu-latest
steps:
# Get the package version
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: echo "NPM_PKG_VERSION=$(npm pkg get version | sed 's/"//g')" >> $GITHUB_ENV
# Download and update
- uses: actions/download-artifact@v3
- uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.NPM_PKG_VERSION }}
files: |
ubuntu/*
macos/*
windows/*
# !!! This check should be required by GitHub !!!
compile-status-check:
if: always()
needs:
- node-compile
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}