Github packages publish #47
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@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install fonts on Ubuntu | |
run: | | |
[[ '${{ matrix.platform }}' =~ 'ubuntu' ]] && sudo apt-get install -y fonts-ubuntu || true | |
shell: bash | |
- 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: node scripts/gen-es6.js lib/index.mjs | |
- 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@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- 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 }} |