ci: run workflows in release PR (#40) #30
This file contains hidden or 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 | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: {} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.repository, 'StyleShit/') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| node-version: 20.x | |
| - run: npm ci | |
| # See https://github.com/actions/checkout/blob/85e6279cec87321a52edac9c87bce653a07cf6c2/README.md#push-a-commit-using-the-built-in-token | |
| - name: Config git user | |
| run: | | |
| git config --global user.name "StyleShit" | |
| git config --global user.email "32631382+StyleShit@users.noreply.github.com" | |
| - name: Create release PR or publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: npm run release | |
| commit: 'chore(release): publish' | |
| title: 'chore(release): publish' | |
| setupGitUser: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |