Merge pull request #212 from ensdomains/maybe-this-helps #123
This file contains 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 | |
defaults: | |
run: | |
shell: bash | |
env: | |
FORCE_COLOR: true | |
jobs: | |
changelog: | |
name: PR or Release | |
if: ${{ github.repository_owner == 'ensdomains' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build Packages | |
run: pnpm -r build | |
- name: Fix npmrc | |
run: npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Release Pull Request or Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
# Note: pnpm install after versioning is necessary to refresh lockfile | |
version: pnpm chgset:version | |
publish: pnpm release | |
commit: "chore: release" | |
title: "[ci] release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Needs access to publish to npm | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true |