Changesets #113
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: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| branches: | |
| - master | |
| 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/cron (no environment gate, no publish). | |
| version: | |
| timeout-minutes: 14 | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio-google-cloud' | |
| outputs: | |
| hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | |
| steps: | |
| - name: checkout code repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: install pnpm | |
| run: | | |
| npm install --global corepack@latest | |
| corepack enable | |
| corepack install | |
| - name: install dependencies | |
| run: pnpm install | |
| - name: build | |
| 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 | |
| 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. | |
| # Skipped on the daily cron so it never nags when there is nothing to publish. | |
| publish: | |
| needs: version | |
| if: needs.version.outputs.hasChangesets == 'false' && github.event_name != 'schedule' | |
| timeout-minutes: 14 | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - name: checkout code repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: install pnpm | |
| run: | | |
| npm install --global corepack@latest | |
| corepack enable | |
| corepack install | |
| - name: install dependencies | |
| run: pnpm install | |
| - name: build | |
| 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 |