-
Notifications
You must be signed in to change notification settings - Fork 549
107 lines (92 loc) · 2.79 KB
/
release-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
name: Release CI
on:
push:
branches:
- master
tags:
- '[0-9]+.*'
workflow_dispatch:
jobs:
build-and-release:
permissions:
contents: write
runs-on: windows-2019
env:
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_84_0
steps:
- name: Checkout last commit
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure build environment
shell: bash
run: |
cp env.vs2019.bat env.bat
# cache boost
- name: Cache Boost
id: cache-boost
uses: actions/cache@v4
with:
path: |
${{ env.BOOST_ROOT }}
key: ${{ runner.os }}-boost-${{ env.boost_version }}
# install boost if not cached
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
shell: bash
run: |
./install_boost.bat
./build.bat boost arm64
# add msbuild to PATH
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# use upper stream released librime files if stable release
- name: Copy Rime files
run: |
.\github.install.bat
- name: Build data
run: |
.\build.bat data
- name: Build Weasel Release
id: build_weasel
if: startsWith(github.ref, 'refs/tags/')
env:
RELEASE_BUILD: 1
run: |
.\build.bat arm64 installer
- name: Build Weasel Nightly
id: build_weasel_nightly
if: github.ref == 'refs/heads/master'
run: |
.\build.bat arm64 installer
- name: Compress Debug Symbols
shell: pwsh
run: |
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip
- name: Extract changelog
shell: pwsh
run: |
.\extract_changelog.ps1
if: startsWith(github.ref, 'refs/tags/')
# create nightly release
- name: Create Nightly release
if: ${{ github.repository == 'rime/weasel' && github.ref == 'refs/heads/master' }}
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Nightly Build"
files: |
./output/archives/weasel*.exe
./output/archives/symbols.zip
# create stable release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./output/archives/weasel*.exe
./output/archives/symbols.zip
body_path: ${{ github.workspace }}/RELEASE_CHANGELOG.md