try #5
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: prebuild | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
prebuild: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: darwin | |
os: macos-11 | |
node: x64 | |
command: prebuild --arch x64+arm64 | |
- name: win32-x86 | |
os: windows-2019 | |
node: x86 | |
command: prebuild | |
- name: win32-x64 | |
os: windows-2019 | |
node: x64 | |
command: prebuild | |
- name: linux-x64 | |
os: ubuntu-20.04 | |
command: prebuild-cross --tag-libc -i centos7-devtoolset7 -i alpine | |
- name: linux-arm | |
os: ubuntu-20.04 | |
command: prebuild-cross --tag-armv -i linux-arm64-lts -i linux-armv7 -i linux-armv6 | |
- name: android-arm | |
os: ubuntu-20.04 | |
command: prebuild-cross --tag-armv -i android-arm64 -i android-armv7 | |
- name: linux-x86 | |
os: ubuntu-20.04 | |
command: prebuild-cross -i linux-x86 | |
name: Build ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- if: matrix.node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
architecture: ${{ matrix.node }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libdbus-1-dev | |
docker pull ghcr.io/prebuild/centos7-devtoolset7 | |
docker run ghcr.io/prebuild/centos7-devtoolset7 "apt update && apt install libdbus-1-dev cmake" | |
- if: contains(matrix.os, 'macos') | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.21.x' | |
- if: contains(matrix.os, 'windows') | |
uses: microsoft/[email protected] | |
- run: yarn install --ignore-scripts | |
- run: yarn ${{ matrix.command }} | |
- run: tar -zcvf ${{ matrix.name }}.tar.gz -C prebuilds . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }}.tar.gz | |
retention-days: 1 | |
release: | |
needs: prebuild | |
name: Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: artifacts/*/*.tar.gz |