-
Notifications
You must be signed in to change notification settings - Fork 32
87 lines (77 loc) · 2.42 KB
/
release.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
name: release
on:
workflow_dispatch:
branches: [release]
inputs:
tag:
description: "版本号"
type: string
change:
description: "提交内容"
type: string
pr:
description: "需要合并提交"
type: string
mt:
description: "提交到市场"
type: string
jobs:
first:
name: version
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: updatepackage
if: github.event.inputs.tag != ''
run: |
sed -i "s/\"version\":.*$/\"version\": \"${{ github.event.inputs.tag }}\",/" package.json
- name: change
if: github.event.inputs.change != ''
run: |
echo -e "## version ${{ github.event.inputs.tag }}\n\n- ${{ github.event.inputs.change }}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
- name: commit
if: github.event.inputs.tag != '' || github.event.inputs.change != ''
run: |
git config user.name ccagml
git config user.email [email protected]
git add .
git commit -m ${{ github.event.inputs.change }}
git push
- name: needpr
if: github.event.inputs.pr != ''
run: |
gh pr create -B main --title 'Merge release${{ github.event.inputs.tag }} into main' --body 'Created by Github action'
- name: finish
run: |
ls
market:
name: market
needs: first
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event.inputs.mt != ''
steps:
- uses: actions/checkout@v2
- name: updatepackage
if: github.event.inputs.tag != ''
run: |
sed -i "s/\"version\":.*$/\"version\": \"${{ github.event.inputs.tag }}\",/" package.json
- name: change
if: github.event.inputs.change != ''
run: |
echo -e "## version ${{ github.event.inputs.tag }}\n\n- ${{ github.event.inputs.change }}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install Node.js modules
run: npm install
- name: Update Node.js modules
run: npm update
- name: Install vsce
run: npm i -g vsce
- name: Publish
run: vsce publish -p ${{ secrets.VSCE_PAT }}