chore(deps): update pnpm/action-setup action to v4 (#1903) #803
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 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: GitHub context | |
run: echo "$GITHUB_CONTEXT" | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
- name: Checkout | |
if: github.ref == 'refs/heads/main' | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4.0.0 | |
with: | |
run_install: false | |
- name: Fetch all tags (for releases) | |
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Setup Node (uses version in .nvmrc) | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Storing release version for changeset | |
id: release_version | |
run: ./scripts/echo-release-version.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Ouptut version | |
run: echo "The version is ${{ steps.release_version.outputs.VERSION }}" | |
- name: Creating .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
email=nerd@tdeekens.name | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Verify NPM user | |
run: pnpm auth | |
- name: Building packages | |
run: pnpm build | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
# uses: changesets/action@v1 | |
uses: dotansimha/changesets-action@v1.5.2 | |
with: | |
publish: pnpm changeset publish | |
version: pnpm changeset:version-and-format | |
title: 'ci(changesets): version packages' | |
commit: 'ci(changesets): version packages' | |
createGithubReleases: aggregate | |
githubReleaseName: v${{ steps.release_version.outputs.VERSION }} | |
githubTagName: v${{ steps.release_version.outputs.VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Publishing canary releases to npm registry | |
if: steps.changesets.outputs.published != 'true' && github.ref == 'refs/heads/main' | |
run: | | |
git checkout main | |
pnpm changeset version --snapshot canary | |
pnpm changeset publish --tag canary | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |