Update GitHub Actions #72
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: yode | |
on: push | |
jobs: | |
build: | |
runs-on: >- | |
${{ | |
(matrix.os == 'mac' && matrix.arch == 'arm64') && | |
'macos-15' || | |
(fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os]) | |
}} | |
continue-on-error: false | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [linux, mac, win] | |
arch: [x64] | |
include: | |
- os: mac | |
arch: arm64 | |
steps: | |
- name: Install Linux Dependencies | |
if: matrix.os == 'linux' | |
run: | | |
sudo apt update | |
sudo apt-get install -y libgtk-3-dev | |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: CCache | |
if: matrix.os == 'linux' || matrix.os == 'mac' | |
uses: hendrikmuhs/[email protected] | |
with: | |
max-size: ${{ matrix.arch == 'arm64' && '3G' || '2G' }} | |
key: ccache-${{ matrix.os }}-${{ matrix.arch }} | |
- name: Build Posix | |
if: matrix.os == 'linux' || matrix.os == 'mac' | |
env: | |
CCACHE_SLOPPINESS: time_macros | |
shell: bash | |
run: | | |
set -e | |
if [ "$(uname)" == "Darwin" ]; then | |
WRAPPER=/usr/local/bin/ccache | |
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then | |
WRAPPER=/usr/bin/ccache | |
fi | |
node build.js --cc-wrapper=$WRAPPER ${{ matrix.arch }} | |
- name: Build Windows | |
if: matrix.os == 'win' | |
run: | | |
node build.js ${{ matrix.arch }} | |
- name: Test | |
if: matrix.arch == 'x64' || matrix.arch == 'ia32' | |
env: | |
DISPLAY: ':99.0' | |
run: out/Release/yode test/main.js | |
- name: Upload Binary Files | |
uses: actions/upload-artifact@v4 | |
with: | |
path: out/Release/*.zip | |
retention-days: 1 | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Files | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
name: Yode ${{ github.ref_name }} | |
body: '## Changelog' | |
files: '*.zip' |