Skip to content

Commit

Permalink
ci: fix publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 20, 2023
1 parent c21a7de commit c551c9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.FETCH_GITHUB_TOKEN }}

- run: pnpm run bump
- name: bump
run: pnpm run bump

- uses: EndBug/add-and-commit@v9
if: ${{ env.TM_CHANGED == 'true' }}
if: ${{ steps.bump.outputs.CHANGED == 'true' }}
with:
author_name: GitHub Actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
message: 'feat: update Themes and Grammars [ci skip]'

- run: pnpm -r publish
if: ${{ env.TM_CHANGED == 'true' }}
if: ${{ steps.bump.outputs.CHANGED == 'true' }}
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions scripts/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ if (themesChanged) {
await bumpVersion('packages/tm-themes/package.json')
}

if ((grammarsChanged || themesChanged) && process.env.GITHUB_ENV) {
console.log('Grammars or themes changed, setting TM_CHANAGED=true...', process.env.GITHUB_ENV)
await fs.writeFile(process.env.GITHUB_ENV, `TM_CHANAGED=true`, 'utf-8')
if ((grammarsChanged || themesChanged) && process.env.GITHUB_OUTPUT) {
console.log('Grammars or themes changed, setting CHANAGED=true...', process.env.GITHUB_OUTPUT)
await fs.writeFile(process.env.GITHUB_OUTPUT, `CHANAGED=true`, 'utf-8')
}

if (!grammarsChanged && !themesChanged) {
Expand Down

0 comments on commit c551c9a

Please sign in to comment.