workaround changesets creating npmrc (#392) #28
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: Packages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| CI: true | |
| PNPM_CACHE_FOLDER: .pnpm-store | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| release: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@master | |
| with: | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| # Needed to ensure we always use the atlas-dst-bot creds. | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: "package.json" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup pnpm config | |
| run: pnpm config set store-dir $PNPM_CACHE_FOLDER | |
| - name: Install dependencies | |
| run: pnpm i | |
| - name: Setup git user | |
| run: | | |
| git config user.name "triplex-bot" | |
| git config user.email "124734075+triplex-bot@users.noreply.github.com" | |
| - name: Create release PR or publish to npm | |
| uses: changesets/action@v1 | |
| with: | |
| commit: "chore: update package versions" | |
| commitMode: "git-cli" | |
| createGithubReleases: false | |
| publish: rm -f .npmrc && pnpm ci:publish | |
| setupGitUser: false | |
| title: "Release packages" | |
| version: pnpm ci:version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true |