Merge pull request #68 from Authress/release/3.0 #223
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - 'release/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - 'release/**' | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install packages | |
| run: npm install | |
| - name: Run build | |
| run: node make.js build | |
| - name: Test | |
| run: yarn lint && yarn test | |
| - name: Deploy to NPM | |
| if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.event_name == 'push' | |
| # Version 11.5.1 or later is required for npm publish | |
| run: | | |
| npm install -g npm@11.5.1 | |
| npm publish --access public | |
| - name: After build | |
| if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.event_name == 'push' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node make.js after_build | |
| - name: Create Github Release and Tag | |
| if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.event_name == 'push' | |
| run: | | |
| git tag ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER | |
| git push origin ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER |