This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
patch #28
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: 'patch' | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
permissions: read-all | |
jobs: | |
generate: | |
name: Run bindings generation | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@main | |
- name: Checkout wiki code | |
uses: actions/checkout@main | |
with: | |
repository: ${{github.repository}}.wiki | |
path: markdown/ | |
- uses: denoland/setup-deno@main | |
with: | |
deno-version: vx.x.x | |
- uses: actions/setup-node@main | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
node-version: 18 | |
- name: Generate bindings patch | |
run: | | |
deno task generate | |
cp -f ./README.md ./package/README.md | |
cd ./package | |
VERSION=$(node -p -e "require('./package.json').version") | |
VERSION=$(node -p -e "'${VERSION}'.split('.').map((x, index) => index === 2 ? parseInt(x) + 1 : x).join('.')") | |
x=$(node -p -e "const x = require('./package.json'); x.version = '${VERSION}'; | |
require('fs').writeFileSync('./package.json', JSON.stringify(x, null, ' '))") | |
npm install | |
npm run build | |
echo registry=https://registry.npmjs.org/ > .npmrc | |
echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} >> .npmrc | |
echo always-auth=true >> .npmrc | |
npm publish --access public | |
echo registry=https://npm.pkg.github.com/ > .npmrc | |
echo //npm.pkg.github.com/:_authToken=${{ github.token }} >> .npmrc | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
PATCH: true |