[MERGE] PR #4 - woodbrettm/changeset-release/main #8
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: On Push To Main Branch | |
on: | |
push: | |
branches: | |
- main | |
# So no other instances of release workflow run at same time | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Changesets Release Flow | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Prep Project | |
uses: ./.github/composite-actions/node-setup-ubuntu | |
- name: Code Checks | |
uses: ./.github/composite-actions/code-checks | |
- name: 1Password Load Tokens | |
id: op-tokens | |
uses: 1password/load-secrets-action@v1 | |
with: | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
NPM_TOKEN: op://dev/css-preflight/github-actions-npm-token | |
- name: Release Pull Request or Publish to NPM | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# NPM_TOKEN: set in steps.op-tokens (export-env: true) | |
- name: Regen Readme NPM Badge | |
run: curl -X GET "https://img.shields.io/npm/v/css-preflight?color=red" | |
shell: bash |