Skip to content

Commit ea81d73

Browse files
committed
chore: update workflows config.
1 parent 9bc8ffb commit ea81d73

File tree

2 files changed

+128
-112
lines changed

2 files changed

+128
-112
lines changed

.github/workflows/ci.yml

Lines changed: 109 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -6,104 +6,113 @@ on:
66

77
jobs:
88
build-deploy:
9-
runs-on: ubuntu-18.04
9+
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
13-
with:
14-
node-version: 14
15-
16-
- run: npm install
17-
- run: npm run compile
18-
- run: npm run compile:min
19-
- run: mkdir -p build
20-
- run: cp -r reset.* ./build
21-
22-
- run: npm i markdown-to-html-cli -g
23-
- run: markdown-to-html --output build/doc.html --favicon 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>💅</text></svg>'
24-
25-
- name: Create Index.html
26-
working-directory: build
27-
run: |
28-
cat > index.html << EOF
29-
<!DOCTYPE html><html lang="en">
30-
<head>
31-
<title>reset-css</title>
32-
<meta name="description" content="A tiny modern CSS reset.">
33-
<link rel="stylesheet" type="text/css" href="reset.min.css" />
34-
<style>
35-
.docbtn { background: #2196f3; display: inline-block; padding: 5px 12px; color: #fff; border-radius: 2px; transition: all 0.3s; position: fixed; left: 10px; top: 10px; }
36-
.docbtn:hover { background: #377eb7; color: #fff; }
37-
</style>
38-
</head>
39-
<body style="text-align: center;">
40-
<a target="__blank" class="docbtn" href="doc.html">Document</a>
41-
<a href="https://github.com/uiwjs/reset-css" target="__blank">
42-
<h1 style="font-size: 46px; padding: 50px 0 0 0; font-weight: bold;">reset.css</h1>
43-
</a>
44-
<p style="padding-bottom: 30px;color: #a5a5a5;">A tiny modern CSS reset.</p>
45-
<div>
46-
<a href="./reset.css">reset.css</a>
47-
</div>
48-
<div>
49-
<a href="./reset.less">reset.less</a>
50-
</div>
51-
<div>
52-
<a href="./reset.min.css">reset.min.css</a>
53-
</div>
54-
</body></html>
55-
EOF
56-
57-
- name: Is a tag created auto?
58-
id: create_tag
59-
uses: jaywcjlove/[email protected]
60-
with:
61-
package-path: ./package.json
62-
63-
- name: get tag version
64-
id: tag_version
65-
uses: jaywcjlove/[email protected]
66-
67-
- name: Deploy
68-
uses: peaceiris/actions-gh-pages@v3
69-
with:
70-
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
71-
github_token: ${{ secrets.GITHUB_TOKEN }}
72-
publish_dir: ./build
73-
74-
- name: Generate Changelog
75-
id: changelog
76-
uses: jaywcjlove/[email protected]
77-
if: steps.create_tag.outputs.successful
78-
with:
79-
token: ${{ secrets.GITHUB_TOKEN }}
80-
head-ref: ${{steps.create_tag.outputs.version}}
81-
filter-author: (小弟调调™|Renovate Bot)
82-
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
83-
84-
- name: Create Release
85-
uses: ncipollo/release-action@v1
86-
if: steps.create_tag.outputs.successful
87-
with:
88-
token: ${{ secrets.GITHUB_TOKEN }}
89-
name: ${{ steps.create_tag.outputs.version }}
90-
tag: ${{ steps.create_tag.outputs.version }}
91-
body: |
92-
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/reset.css@${{steps.create_tag.outputs.versionNumber}}/file/README.md)
93-
94-
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/reset-css/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
95-
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
96-
97-
```bash
98-
npm i @uiw/reset.css@${{steps.create_tag.outputs.versionNumber}}
99-
```
100-
101-
${{ steps.changelog.outputs.changelog }}
102-
103-
- run: git status
104-
105-
- name: 📦 @uiw/reset.css publish to NPM
106-
uses: JS-DevTools/npm-publish@v1
107-
with:
108-
token: ${{ secrets.NPM_TOKEN }}
109-
package: ./package.json
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 16
15+
registry-url: 'https://registry.npmjs.org'
16+
17+
18+
- run: npm install
19+
- run: npm run compile
20+
- run: npm run compile:min
21+
- run: mkdir -p build
22+
- run: cp -r reset.* ./build
23+
24+
- run: npm i markdown-to-html-cli -g
25+
- run: markdown-to-html --output build/doc.html --favicon 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>💅</text></svg>'
26+
27+
- name: Create Index.html
28+
working-directory: build
29+
run: |
30+
cat > index.html << EOF
31+
<!DOCTYPE html><html lang="en">
32+
<head>
33+
<title>reset-css</title>
34+
<meta name="description" content="A tiny modern CSS reset.">
35+
<link rel="stylesheet" type="text/css" href="reset.min.css" />
36+
<style>
37+
.docbtn { background: #2196f3; display: inline-block; padding: 5px 12px; color: #fff; border-radius: 2px; transition: all 0.3s; position: fixed; left: 10px; top: 10px; }
38+
.docbtn:hover { background: #377eb7; color: #fff; }
39+
</style>
40+
</head>
41+
<body style="text-align: center;">
42+
<a target="__blank" class="docbtn" href="doc.html">Document</a>
43+
<a href="https://github.com/uiwjs/reset-css" target="__blank">
44+
<h1 style="font-size: 46px; padding: 50px 0 0 0; font-weight: bold;">reset.css</h1>
45+
</a>
46+
<p style="padding-bottom: 30px;color: #a5a5a5;">A tiny modern CSS reset.</p>
47+
<div>
48+
<a href="./reset.css">reset.css</a>
49+
</div>
50+
<div>
51+
<a href="./reset.less">reset.less</a>
52+
</div>
53+
<div>
54+
<a href="./reset.min.css">reset.min.css</a>
55+
</div>
56+
</body></html>
57+
EOF
58+
59+
- name: Is a tag created auto?
60+
id: create_tag
61+
uses: jaywcjlove/create-tag-action@main
62+
with:
63+
package-path: ./package.json
64+
65+
- name: get tag version
66+
id: tag_version
67+
uses: jaywcjlove/changelog-generator@main
68+
69+
- name: Deploy
70+
uses: peaceiris/actions-gh-pages@v3
71+
with:
72+
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
73+
github_token: ${{ secrets.GITHUB_TOKEN }}
74+
publish_dir: ./build
75+
76+
- name: Generate Changelog
77+
id: changelog
78+
uses: jaywcjlove/changelog-generator@main
79+
if: steps.create_tag.outputs.successful
80+
with:
81+
token: ${{ secrets.GITHUB_TOKEN }}
82+
head-ref: ${{steps.create_tag.outputs.version}}
83+
filter-author: (小弟调调™|Renovate Bot)
84+
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
85+
86+
- name: Create Release
87+
uses: ncipollo/release-action@v1
88+
if: steps.create_tag.outputs.successful
89+
with:
90+
token: ${{ secrets.GITHUB_TOKEN }}
91+
name: ${{ steps.create_tag.outputs.version }}
92+
tag: ${{ steps.create_tag.outputs.version }}
93+
body: |
94+
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/reset.css@${{steps.create_tag.outputs.versionNumber}}/file/README.md)
95+
96+
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/reset-css/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
97+
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
98+
99+
```bash
100+
npm i @uiw/reset.css@${{steps.create_tag.outputs.versionNumber}}
101+
```
102+
103+
${{ steps.changelog.outputs.changelog }}
104+
105+
- run: git status
106+
107+
108+
- run: npm publish
109+
name: 📦 @uiw/reset.css publish to NPM
110+
continue-on-error: true
111+
env:
112+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
113+
114+
# - name: 📦 @uiw/reset.css publish to NPM
115+
# uses: JS-DevTools/npm-publish@v1
116+
# with:
117+
# token: ${{ secrets.NPM_TOKEN }}
118+
# package: ./package.json

.github/workflows/publish.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
contents: read
1111
packages: write
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v2
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
1515
with:
16-
node-version: '16.x'
16+
node-version: 16
1717
registry-url: 'https://npm.pkg.github.com'
1818
scope: '@uiwjs'
1919

@@ -30,19 +30,26 @@ jobs:
3030
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131

3232
npm-publish:
33-
runs-on: ubuntu-18.04
33+
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v2
36-
- uses: actions/setup-node@v2
35+
- uses: actions/checkout@v3
36+
- uses: actions/setup-node@v3
3737
with:
38-
node-version: 14
38+
node-version: 16
39+
registry-url: 'https://registry.npmjs.org'
3940

4041
- run: npm install
4142
- run: npm run compile
4243
- run: npm run compile:min
4344

44-
- name: 📦 @uiw/reset.css publish to NPM
45-
uses: JS-DevTools/npm-publish@v1
46-
with:
47-
token: ${{ secrets.NPM_TOKEN }}
48-
package: ./package.json
45+
- run: npm publish
46+
name: 📦 @uiw/reset.css publish to NPM
47+
continue-on-error: true
48+
env:
49+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
50+
51+
# - name: 📦 @uiw/reset.css publish to NPM
52+
# uses: JS-DevTools/npm-publish@v1
53+
# with:
54+
# token: ${{ secrets.NPM_TOKEN }}
55+
# package: ./package.json

0 commit comments

Comments
 (0)