convert from commonjs to es6/ecma modules #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: publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- package.json | |
release: | |
types: [published] | |
env: | |
CI: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo /etc/init.d/mysql start | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: sh sql/init-mysql.sh | |
- run: npm install | |
- run: npm test | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
name: Node ${{ env.node-version }} | |
with: | |
node-version: ${{ env.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# fetch-depth 0 needed by GitHub Release | |
- name: publish to NPM | |
run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: GitHub Release | |
uses: justincy/github-action-npm-release@2.0.1 | |
id: release | |
publish-gpr: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node-version }} | |
registry-url: https://npm.pkg.github.com/ | |
scope: '@nictool' | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |