ci: run typecheck + lint prior to release #35
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - alpha | |
| jobs: | |
| release: | |
| name: Release | |
| environment: | |
| name: npm-production | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # for checkout | |
| id-token: write # to enable use of OIDC for npm provenance | |
| steps: | |
| - name: Create app token | |
| uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.ECOSPARK_APP_ID }} | |
| private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| # Need all history to analyze commits since last release | |
| fetch-depth: 0 | |
| # Uses generated token to allow pushing commits back | |
| token: ${{ steps.app-token.outputs.token }} | |
| # Make sure GITHUB_TOKEN will not be persisted in repo's config | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Lint | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm test | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| run: npx semantic-release |