Build #1370
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: | |
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/extract-package-version@v1.2.1 | |
- 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 --vs2022 | |
# uses: microsoft/setup-msbuild@v1.0.3 | |
if: matrix.os == 'windows-latest' | |
# 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 2022 | |
- 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/extract-package-version@v1.2.1 | |
- 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/keepalive-workflow@1.1.0 | |