Merge pull request #601 from supermacro/changeset-release/master #26
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: | |
- master | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
create_pr: | |
name: Release | |
runs-on: ubuntu-latest | |
outputs: | |
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- run: npm i | |
- name: Create Release Pull Request | |
id: changesets | |
uses: changesets/action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
needs: create_pr | |
if: needs.create_pr.outputs.hasChangesets == 'false' | |
runs-on: ubuntu-latest | |
environment: deploy | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- run: npm i | |
- name: release | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: npm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |