Skip to content

Commit

Permalink
feat: add publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcapoe committed Sep 8, 2023
1 parent 8ce7587 commit 16cfd6a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
node-version: 18.x
registry-url: https://registry.npmjs.org/

- run: npm install
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish

on:
workflow_run:
workflows: ["CI"]
types:
- completed
push:
branches:
- "main"

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js and npm
uses: actions/setup-node@v2
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 16cfd6a

Please sign in to comment.