Github packages publish #54
Workflow file for this run
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: Github packages publish | |
on: workflow_dispatch | |
jobs: | |
native: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-20.04, macos-11, windows-2022] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install fonts on Ubuntu | |
run: sudo apt-get install -y fonts-ubuntu || true | |
if: startsWith(matrix.platform, 'ubuntu') | |
- name: Install conan dependencies | |
run: npm run conan:native | |
- run: npm install --ignore-scripts | |
- run: npm run deps:download | |
- run: npx @mapbox/node-pre-gyp configure | |
- run: npx @mapbox/node-pre-gyp build | |
- run: npx mocha test/node.test.ts test/integration.test.ts | |
env: | |
MOCHA_INTEGRATION: node | |
MOCHA_MAGICK_INSTALL: "node -e \"fs.symlinkSync(process.env.GITHUB_WORKSPACE, path.resolve('node_modules', 'magickwand.js'), os.platform() == 'win32' ? 'junction': 'dir')\"" | |
- run: npx @mapbox/node-pre-gyp package | |
- run: npx @mmomtchev/node-pre-gyp-github publish | |
env: | |
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }} | |
wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install conan dependencies | |
run: npm run conan:emscripten | |
- run: npm install --ignore-scripts | |
- run: npm run deps:download | |
- run: npx @mapbox/node-pre-gyp configure --nodedir=./emscripten --target_arch=wasm32 --target_platform=emscripten | |
- run: npx @mapbox/node-pre-gyp build | |
- name: Run headless test | |
uses: GabrielBB/xvfb-action@v1 | |
env: | |
MOCHA_INTEGRATION: browser | |
MOCHA_MAGICK_INSTALL: ln -s ${{ github.workspace }} node_modules/magickwand.js | |
with: | |
run: npx mocha test/browser.test.ts test/integration.test.ts | |
- name: Package and publish | |
run: | | |
touch lib/binding/emscripten-wasm32/magickwand.node | |
npx @mapbox/node-pre-gyp package --nodedir=./emscripten --target_arch=wasm32 --target_platform=emscripten | |
npx @mmomtchev/node-pre-gyp-github publish | |
env: | |
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }} |