-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (103 loc) · 3.45 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
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
name: release
on:
push:
tags:
- v*
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
# TODO : true if tag contain "rc"
prerelease: false
build-msys-mingw64:
name: Build for Windows
needs: create-release
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup msys2 dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git zip mingw-w64-x86_64-libzip mingw-w64-x86_64-rust mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-pkg-config
- name: Run cargo check
run: cargo check --release
- name: Build
run: cargo build --release
- name: Package
run: tools/package_release_windows.sh ${{ github.ref_name }}
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
with:
path: setup.iss
options: /O+
- name: Upload binaries
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: TrSync_${{ github.ref_name }}_Win64.zip
asset_name: TrSync_${{ github.ref_name }}_Win64.zip
asset_content_type: application/zip
- name: Upload installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: Output\trsync.exe
asset_name: TrSync_${{ github.ref_name }}_Win64_installer.exe
asset_content_type: application/octet-stream
build-linux:
name: Build for Linux
needs: create-release
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install OS dependencies
run: sudo apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev libpango1.0-dev libgtk-3-dev
- name: Run cargo check
run: cargo check --release
- name: Build
run: cargo build --release
- name: Package
run: tools/package_release_linux.sh ${{ github.ref_name }}
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: TrSync_${{ github.ref_name }}_Linux.zip
asset_name: TrSync_${{ github.ref_name }}_Linux.zip
asset_content_type: application/zip