Skip to content

Build

Build #1838

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
make_matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'yarn'
- run: yarn install
- run: npx tsc
- run: node ./dist/makeMatrix.js
- id: set-matrix
run: |
JSON=$(cat ./matrix.json)
echo $JSON
echo "matrix=${JSON//'%'/'%25'}" >> $GITHUB_OUTPUT
make_release:
name: Generate Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: Saionaro/[email protected]
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- id: checkTag
run: git show-ref --tags --verify --quiet -- "refs/tags/v${{ steps.package-version.outputs.version }}" && echo "tagged=1" >> $GITHUB_OUTPUT || echo "tagged=0" >> $GITHUB_OUTPUT
- run: echo ${{ steps.checkTag.outputs.tagged }}
- name: Create Release
id: create_release
if: steps.checkTag.outputs.tagged == 0
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.version }}
release_name: v${{ steps.package-version.outputs.version }}
draft: false
prerelease: true
build:
continue-on-error: true
name: Build
needs: [make_matrix, make_release]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.make_matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'yarn'
# linux
- if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib
# mac
- if:
matrix.os == 'macos-latest'
run: brew install p7zip
# windows
- name: Add msbuild to PATH
run: yarn global add --production windows-build-tools --vs2019
# uses: microsoft/[email protected]
if: matrix.os == 'windows-2019'
# nw.js
# - if: matrix.runtime == 'nw.js'
# uses: MatteoH2O1999/setup-python@v1
# with:
# python-version: 2.7.18
# allow-build: info
# cache-build: true
# cache: pip
- if: matrix.runtime == 'nw.js'
uses: actions/setup-python@v4
with:
python-version: 'pypy2.7-v7.3.12'
- if: matrix.runtime == 'nw.js'
run: |
yarn config set python python2.7
yarn config set msvs_version 2019
- run: git clone https://github.com/greenheartgames/greenworks greenworks
- run: gcc -v
- run: g++ -v
# Extract
- run: 7z x sdk.zip -y -p${{ secrets.ZIP_PASSWORD }}
- run: mv sdk greenworks/deps/steamworks_sdk
- run: yarn install
- run: |
cd greenworks
# git apply ../diff.patch
yarn install
cat package.json
- run: ls
# - name: "ls"
# shell: bash
# run:
# ls "${{env.pythonLocation}}"
- run: npx tsc
- name: "Build"
shell: bash
run: |
node dist/index.js --os=${{matrix.os}} --runtime=${{matrix.runtime}} --arch=${{matrix.arch}}
- name: get-npm-version
id: package-version
uses: Saionaro/[email protected]
- name: "ls"
shell: bash
run:
ls greenworks/build/Release/
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: ./artifacts/*
tag: v${{ steps.package-version.outputs.version }}
overwrite: true
file_glob: true
- name: Keepalive Workflow
uses: gautamkrishnar/[email protected]