Skip to content

Commit 619dc62

Browse files
committed
ci: concat jobs
1 parent 478511d commit 619dc62

File tree

3 files changed

+22
-60
lines changed

3 files changed

+22
-60
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
name: Build Demo and Deploy to Github Pages
1+
name: Build Demo, Deploy to Github Pages, Publish to NPM, Release with Changelog
2+
# concat workflows because it is not easy to run trigger multiple. https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
23
permissions:
34
contents: write
45
on:
5-
# release:
6-
# types: [prereleased, released, published]
7-
# above does not work
8-
workflow_run:
9-
workflows: ["release.yml"]
10-
types:
11-
- completed
6+
push:
7+
tags:
8+
- "v*"
129

1310
jobs:
1411
build:
@@ -23,8 +20,11 @@ jobs:
2320
with:
2421
node-version: "20.x"
2522

26-
- name: Install and Build
27-
run: npm install && npm run build:web
23+
- name: Install
24+
run: npm install
25+
26+
- name: Build Demo
27+
run: npm run build:web
2828

2929
- name: Extra Files
3030
run: |
@@ -44,3 +44,15 @@ jobs:
4444
branch: gh-pages
4545
clean: true
4646
folder: dist
47+
- name: Remove Dist
48+
run: rm -rf dist
49+
- name: Build Library
50+
run: npm run build
51+
- run: rm -rf node_modules && npm ci
52+
- run: npm publish
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
- name: Release with Changelog
56+
run: npx changelogithub # or [email protected] if ensure the stable result
57+
env:
58+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/publish.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)