Add more logging. #6
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 | |
| - 'release/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release/**' | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| nodejs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.19 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Merge PR into target before building | |
| if: github.event_name == 'pull_request' | |
| env: | |
| BASE_BRANCH: ${{ github.base_ref }} | |
| run: | | |
| git config --global user.email "github@rhosys.github.com" | |
| git config --global user.name "GitHub Runner" | |
| git fetch origin $BASE_BRANCH --deepen=50 | |
| git merge origin/${BASE_BRANCH} --allow-unrelated-histories --no-edit | |
| - name: Install packages | |
| run: npm ci | |
| - name: Run build | |
| run: npm run build | |
| - name: Test | |
| run: npm run lint && npm run test | |
| - name: Deploy to NPM | |
| if: github.ref != 'refs/heads/main' && github.event_name == 'push' | |
| # Version 11.5.1 or later is required for npm publish | |
| run: | | |
| npm install -g npm@latest | |
| npm publish --provenance --access public | |
| - name: Create Github Release and Tag | |
| if: github.ref != 'refs/heads/main' && 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 |