-
Notifications
You must be signed in to change notification settings - Fork 345
76 lines (71 loc) · 2.88 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
name: Release-Tag-Work
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: |
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install gcc-mingw-w64-x86-64
make
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }} # 之前GitHub添加的Token
with:
tag_name: ${{ github.ref }} # (tag)标签名称
release_name: wechat-backup-${{ steps.get_version.outputs.VERSION }}
draft: false # 是否是草稿
prerelease: false # 是否是预发布
# 上传构建结果到 Release(把打包的tgz上传到Release)
- name: build TAR PACKAGE
run: |
tar -czvf wechat-backup-linux.tar.gz ./dist/linux
tar -czvf wechat-backup-arm64.tar.gz ./dist/linux-arm64
tar -czvf wechat-backup-windows.tar.gz ./dist/windows
- name: Upload Release Linux
id: upload-release-linux
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }} # (tag)标签名称
upload_url: ${{ steps.create_release.outputs.upload_url }} # 上传地址,通过创建Release获取到的
asset_path: ./wechat-backup-linux.tar.gz # 要上传文件
asset_name: wechat-backup_linux_${{ steps.get_version.outputs.VERSION }}.tar.gz # 上传后的文件名
asset_content_type: application/gzip
- name: Upload Release Arm64
id: upload-release-arm64
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }} # (tag)标签名称
upload_url: ${{ steps.create_release.outputs.upload_url }} # 上传地址,通过创建Release获取到的
asset_path: ./wechat-backup-arm64.tar.gz # 要上传文件
asset_name: wechat-backup_arm64_${{ steps.get_version.outputs.VERSION }}.tar.gz # 上传后的文件名
asset_content_type: application/gzip
- name: Upload Release windows
id: upload-release-windows
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }} # (tag)标签名称
upload_url: ${{ steps.create_release.outputs.upload_url }} # 上传地址,通过创建Release获取到的
asset_path: ./wechat-backup-windows.tar.gz # 要上传文件
asset_name: wechat-backup_windows_${{ steps.get_version.outputs.VERSION }}.tar.gz # 上传后的文件名
asset_content_type: application/gzip