Release #59
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: Release | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: node_modules cache | |
uses: actions/[email protected] | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: externals cache | |
uses: actions/[email protected] | |
if: runner.os != 'Windows' | |
with: | |
path: externals | |
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.sh') }} | |
- name: externals cache (Windows) | |
uses: actions/[email protected] | |
if: runner.os == 'Windows' | |
with: | |
path: externals | |
key: ${{ runner.os }}-externals-${{ hashFiles('scripts/prepare-*.ps1') }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Prepare & build (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
powershell ./scripts/prepare-windows.ps1 | |
powershell ./scripts/build-windows.ps1 | |
- name: Prepare & build (Linux x86_64) | |
if: runner.os == 'Linux' | |
run: | | |
bash ./scripts/prepare-linux.sh | |
bash ./scripts/build-linux.sh | |
- name: Prepare & build (Linux arm64) | |
if: runner.os == 'Linux' | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker run --rm --volume $(pwd):/app --workdir /app -t arm64v8/ubuntu bash -c "./scripts/prepare-linux.sh && ./scripts/build-linux.sh" | |
- name: Build (macOS) | |
if: runner.os == 'macOS' | |
run: bash ./scripts/build-macos.sh | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bin-${{ matrix.os }} | |
path: bin | |
retention-days: 3 | |
publish: | |
permissions: | |
contents: write | |
pull-requests: read | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: node_modules cache | |
uses: actions/[email protected] | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Download bundled files | |
uses: actions/download-artifact@v4 | |
with: | |
path: bin | |
pattern: bin-* | |
merge-multiple: true | |
- run: yarn install | |
- run: yarn build | |
- name: Publish to NPM | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{secrets.NPM_TOKEN}} | |
- name: Draft release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true |