-
Notifications
You must be signed in to change notification settings - Fork 279
104 lines (89 loc) · 2.92 KB
/
release-tag.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
#https://github.com/yyx990803/release-tag
name: Create Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
#on:
# push:
# branch: ['master']
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@master
# 拉取web前端dist的代码
- name: Checkout Web Dist
uses: actions/checkout@v3
with:
repository: 'mouday/domain-admin-web'
ref: 'dist'
token: ${{ secrets.GH_PAT }}
path: 'domain_admin/public'
- name: Checkout Mini Dist
uses: actions/checkout@v3
with:
repository: 'mouday/domain-admin-mini'
ref: 'dist'
token: ${{ secrets.GH_PAT }}
path: 'domain_admin/public/m'
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build Dist
run: |
python setup.py sdist bdist_wheel --python-tag py2.py3
# 拉取前端最新的master代码
- name: Checkout Web Master
uses: actions/checkout@v3
with:
repository: 'mouday/domain-admin-web'
ref: 'master'
token: ${{ secrets.GH_PAT }}
path: 'domain_admin_web'
# https://github.com/a7ul/tar-action
# https://docs.github.com/zh/actions/learn-github-actions/contexts#github-context
- name: Compress action step Web
uses: a7ul/[email protected]
id: compress-web
with:
command: c
cwd: ./
files: |
./domain_admin_web
outPath: ./dist/domain-admin-web-${{github.ref_name}}.tar.gz
# 拉取H5前端最新的master代码
- name: Checkout Mini Master
uses: actions/checkout@v3
with:
repository: 'mouday/domain-admin-mini'
ref: 'master'
token: ${{ secrets.GH_PAT }}
path: 'domain_admin_mini'
# remove .git
- name: Remove .git Dir
run: rm -rf '.git' 'domain_admin/public/.git' 'domain_admin/public/m/.git'
- name: Compress action step Mini
uses: a7ul/[email protected]
id: compress-mini
with:
command: c
cwd: ./
files: |
./domain_admin_mini
outPath: ./dist/domain-admin-mini-${{github.ref_name}}.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./dist/*
body: Please refer to [CHANGELOG.md](https://domain-admin.readthedocs.io/zh_CN/latest/manual/changelog.html) for details.
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo