Replace Semantic Release action with direct command #145
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
| name: Run tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - beta | |
| - alpha | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v1 | |
| - name: Use node 24 | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 24 | |
| - name: Install depencencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm run test | |
| release: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/alpha' | |
| permissions: | |
| contents: write # to be able to publish a GitHub release | |
| issues: write # to be able to comment on released issues | |
| pull-requests: write # to be able to comment on released pull requests | |
| id-token: write # to enable use of OIDC for trusted publishing and npm provenance | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v1 | |
| - name: Use node 24 | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 24 | |
| - uses: svrooij/secret-gate-action@v1 # see https://github.com/svrooij/secret-gate-action this is to fail quiet until secret is set. | |
| id: mygate | |
| with: | |
| inputsToCheck: 'NPM_TOKEN' | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install depencencies | |
| if: steps.mygate.outputs.inputsChecked == 'true' | |
| run: npm ci | |
| - name: Run tests | |
| if: steps.mygate.outputs.inputsChecked == 'true' | |
| run: npm run test | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release |