fix: allow aggregation by date #616
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: Lint, Build, Test and Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Installing & Building | |
| runs-on: ubuntu-latest | |
| 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 npm provenance | |
| steps: | |
| - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false # GITHUB_TOKEN must not be set for the semantic release | |
| # https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#pushing-packagejson-changes-to-your-repository | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.21.0 | |
| - name: Upgrade npm | |
| run: npm install -g npm@latest | |
| - name: Install | |
| run: yarn | |
| - name: Lint, Test & Build on branch | |
| if: github.ref != 'refs/heads/main' | |
| run: npx nx affected --base=origin/main -t lint test build | |
| - name: Lint, Test & Build on main | |
| if: | | |
| github.event_name == 'push' | |
| && ( | |
| github.ref == 'refs/heads/main' | |
| ) | |
| run: npx nx affected --base=origin/main~1 --head=origin/main -t lint test build | |
| - name: Publish from main | |
| if: | | |
| github.event_name == 'push' | |
| && ( | |
| github.ref == 'refs/heads/main' | |
| ) | |
| run: npx nx affected --base=origin/main~1 --head=origin/main -t publish:package | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
| GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
| GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
| GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | |
| NPM_CONFIG_PROVENANCE: true |