chore: fix ci (#355) #56
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: Changesets | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| env: | |
| CI: true | |
| PNPM_CACHE_FOLDER: .pnpm-store | |
| NPM_CONFIG_PROVENANCE: 'true' | |
| jobs: | |
| # Open/refresh the "build: release packages" version PR from changesets. | |
| # Runs freely on every push to main (no environment gate, no publish). | |
| version: | |
| timeout-minutes: 14 | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.repository == 'verdaccio/e2e-tests' | |
| outputs: | |
| hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | |
| steps: | |
| - name: checkout code repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: install pnpm | |
| run: npm i -g corepack@latest || corepack enable && corepack prepare pnpm@latest --activate | |
| - name: install dependencies | |
| run: pnpm install | |
| - name: build packages | |
| run: pnpm build | |
| - name: create versions | |
| id: changesets | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b | |
| with: | |
| version: pnpm ci:version | |
| commit: 'build: release packages' | |
| title: 'build: release packages' | |
| setupGitUser: true | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| # Publish to npm once the version PR has been merged (no changesets left). | |
| # Gated by the `npm` environment, which requires manual approval. | |
| publish: | |
| needs: version | |
| if: needs.version.outputs.hasChangesets == 'false' | |
| timeout-minutes: 14 | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - name: checkout code repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: install pnpm | |
| run: npm i -g corepack@latest || corepack enable && corepack prepare pnpm@latest --activate | |
| - name: install dependencies | |
| run: pnpm install | |
| - name: build packages | |
| run: pnpm build | |
| - name: publish | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b | |
| with: | |
| publish: pnpm ci:publish | |
| createGithubReleases: true | |
| setupGitUser: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org |