-
-
Notifications
You must be signed in to change notification settings - Fork 557
192 lines (164 loc) · 13.9 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: CI
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm -v
- run: npm install
- name: Converts Markdown to HTML
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: packages/core/README.md
output: ./packages/core/dist/index.htm
github-corners: https://github.com/uiwjs/province-city-china
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>
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: ./packages/core/dist/CONTRIBUTORS.svg
avatarSize: 42
- run: npm run sql
- run: npm run level
- run: npm run code
- run: npm run copy
- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@main
with:
package-path: ./packages/core/package.json
- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@main
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/core/dist
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
head-ref: ${{steps.create_tag.outputs.version}}
filter-author: (renovate-bot|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
body: |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/province-city-china@${{steps.changelog.outputs.version}}/file/README.md)
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/uiwjs/province-city-china/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
```shell
npm i province-city-china@${{steps.create_tag.outputs.versionNumber}}
```
${{ steps.changelog.outputs.changelog }}
| 文件列表 | JSON | CSV | SQL | CDN |
| ---- | ---- | ---- | ---- | ---- |
| 国家和地区代码列表([#13](https://github.com/uiwjs/province-city-china/issues/13)) | [country.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/country.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/country.min.json)) | [country.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/country.csv) | - | [csv](https://unpkg.com/province-city-china/dist/country.csv) / [json](https://unpkg.com/province-city-china/dist/country.json) |
| 总数据(省/地/县/乡) | [data.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/data.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/data.min.json)) | [data.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/data.csv) | [data.sql](https://github.com/uiwjs/province-city-china/blob/gh-pages/data.sql) | [data.sql](https://unpkg.com/province-city-china/dist/data.sql) / [csv](https://unpkg.com/province-city-china/dist/data.csv) / [json](https://unpkg.com/province-city-china/dist/data.json) |
| 总数据(省/地/县/乡)层级数据 | [level.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/level.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/level.min.json)) | - | - | [level.json](https://unpkg.com/province-city-china/dist/level.json) |
| 省级(省/直辖市/特别行政区) | [province.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/province.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/province.min.json)) | [province.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/province.csv) | - | [province.json](https://unpkg.com/province-city-china/dist/province.json) / [csv](https://unpkg.com/province-city-china/dist/province.csv) |
| 地级(城市) | [city.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/city.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json)) | [city.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/city.csv) | - | [city.json](https://unpkg.com/province-city-china/dist/city.json) / [csv](https://unpkg.com/province-city-china/dist/city.csv) |
| 县级(区县) | [area.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/area.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/area.min.json)) | [area.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/area.csv) | - | [area.json](https://unpkg.com/province-city-china/dist/area.json) / [csv](https://unpkg.com/province-city-china/dist/area.csv) |
| 乡级(乡镇/街) | [town.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/town.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/town.min.json)) | [town.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/town.csv) | - | [town.json](https://unpkg.com/province-city-china/dist/town.json) / [csv](https://unpkg.com/province-city-china/dist/town.csv) |
| 县市区没有乡级数据 | [not-found-town.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.json) ([min](https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.min.json)) | - | - | [not-found-town.json](https://unpkg.com/province-city-china/dist/not-found-town.json) |
| 香港澳门<区>数据 | [hongkong.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.json) <br> [macau.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.json) | [hongkong.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.csv) / [macau.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.csv) | - | [hongkong.json](https://unpkg.com/province-city-china/dist/hongkong.json) ([csv](https://unpkg.com/province-city-china/dist/hongkong.csv)) <br> [macau.json](https://unpkg.com/province-city-china/dist/macau.json) ([csv](https://unpkg.com/province-city-china/dist/macau.csv)) |
| 国内长途电话区号 | [district-code.json](https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.json) | [district-code.csv](https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.csv) | - | [district-code.json](https://unpkg.com/province-city-china/dist/district-code.json) / [csv](https://unpkg.com/province-city-china/dist/district-code.csv) |
| 包名 | 说明 | 版本 | 大小 |
| ---- | ---- | ---- | ---- |
| [province-city-china](https://github.com/uiwjs/province-city-china) | 包含所有包内容 | [![npm package](https://img.shields.io/npm/v/province-city-china.svg)](https://www.npmjs.com/package/province-city-china) | - |
| [@province-city-china/country](https://github.com/uiwjs/province-city-china/tree/master/packages/country) | 国家和地区代码列表 | [![npm package](https://img.shields.io/npm/v/@province-city-china/country.svg)](https://www.npmjs.com/package/@province-city-china/country) |![](https://img.shields.io/bundlephobia/min/@province-city-china/country) |
| [@province-city-china/data](https://github.com/uiwjs/province-city-china/tree/master/packages/data) | 总数据(省/地/县/乡) | [![npm package](https://img.shields.io/npm/v/@province-city-china/data.svg)](https://www.npmjs.com/package/@province-city-china/data) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/data) |
| [@province-city-china/province](https://github.com/uiwjs/province-city-china/tree/master/packages/province) | 省级(省/直辖市/特别行政区) | [![npm package](https://img.shields.io/npm/v/@province-city-china/province.svg)](https://www.npmjs.com/package/@province-city-china/province) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/province) |
| [@province-city-china/city](https://github.com/uiwjs/province-city-china/tree/master/packages/city) | 地级(城市) | [![npm package](https://img.shields.io/npm/v/@province-city-china/city.svg)](https://www.npmjs.com/package/@province-city-china/city) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/city) |
| [@province-city-china/area](https://github.com/uiwjs/province-city-china/tree/master/packages/area) | 县级(区县) | [![npm package](https://img.shields.io/npm/v/@province-city-china/area.svg)](https://www.npmjs.com/package/@province-city-china/area) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/area) |
| [@province-city-china/town](https://github.com/uiwjs/province-city-china/tree/master/packages/town) | 乡级(乡镇/街) | [![npm package](https://img.shields.io/npm/v/@province-city-china/town.svg)](https://www.npmjs.com/package/@province-city-china/town) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/town) |
| [@province-city-china/level](https://github.com/uiwjs/province-city-china/tree/master/packages/level) | 总数据(省/地/县/乡)层级数据 | [![npm package](https://img.shields.io/npm/v/@province-city-china/level.svg)](https://www.npmjs.com/package/@province-city-china/level) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/level) |
| [@province-city-china/utils](https://github.com/uiwjs/province-city-china/tree/master/packages/utils) | 提供使用数据方法 | [![npm package](https://img.shields.io/npm/v/@province-city-china/utils.svg)](https://www.npmjs.com/package/@province-city-china/utils) | ![](https://img.shields.io/bundlephobia/min/@province-city-china/utils) |
| [@province-city-china/types](https://github.com/uiwjs/province-city-china/tree/master/packages/types) | 类型文件 | [![npm package](https://img.shields.io/npm/v/@province-city-china/types.svg)](https://www.npmjs.com/package/@province-city-china/types) | - |
| [@province-city-china/district-code](https://github.com/uiwjs/province-city-china/tree/master/packages/district-code) | 国内长途电话区号 | [![npm package](https://img.shields.io/npm/v/@province-city-china/district-code.svg)](https://www.npmjs.com/package/@province-city-china/district-code) | - |
- run: npm publish --access public --provenance
name: 📦 province-city-china publish to NPM
continue-on-error: true
working-directory: packages/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/area publish to NPM
continue-on-error: true
working-directory: packages/area
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/city publish to NPM
continue-on-error: true
working-directory: packages/city
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/country publish to NPM
continue-on-error: true
working-directory: packages/country
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/data publish to NPM
continue-on-error: true
working-directory: packages/data
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/district-code publish to NPM
continue-on-error: true
working-directory: packages/district-code
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/level publish to NPM
continue-on-error: true
working-directory: packages/level
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/province publish to NPM
continue-on-error: true
working-directory: packages/province
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/town publish to NPM
continue-on-error: true
working-directory: packages/town
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/types publish to NPM
continue-on-error: true
working-directory: packages/types
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public --provenance
name: 📦 @province-city-china/utils publish to NPM
continue-on-error: true
working-directory: packages/utils
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}