Merge pull request #2 from qwikifiers/changeset-release/main #16
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout all commits | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup git user | |
shell: bash | |
run: | | |
git config --global user.name '@qwikifiers' | |
git config --global user.email '[email protected]' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.7.0 | |
- name: Use Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
registry-url: https://registry.npmjs.org | |
cache: 'pnpm' | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install --frozen-lockfile | |
- name: Build packages | |
shell: bash | |
run: pnpm build | |
# - name: Publish any commit / build for testing | |
# run: pnpm release.pkg-pr-new | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release Pull Request or Publish | |
if: github.ref == 'refs/heads/main' | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |