-
Notifications
You must be signed in to change notification settings - Fork 2
149 lines (118 loc) · 5.66 KB
/
cd.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: cd
on:
push:
branches:
- main
jobs:
release:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate Cargo.lock
run: cargo generate-lockfile
working-directory: ./src-tauri
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"
- name: Setup GitVersion
run: dotnet tool install --global GitVersion.Tool
- name: Fetch for GitVersion
run: git fetch --tags --unshallow
- name: Fetch main for GitVersion
if: github.ref != 'refs/heads/main'
run: git branch --create-reflog main origin/main
- name: Update version
run: dotnet-gitversion /updateprojectfiles /updateassemblyinfo /output buildserver
- name: Set job output
id: VERSION
run: |
echo '::set-output name=label::${{env.GitVersion_PreReleaseLabel}}'
echo '::set-output name=semver::${{env.GitVersion_LegacySemVer}}'
echo '::set-output name=nuget::${{env.GitVersion_NuGetPreReleaseTagV2}}'
echo '::set-output name=applicable::${{env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta' }}'
- name: Apply changes
if: ${{ steps.VERSION.outputs.applicable == 'true' && steps.extract_branch.outputs.branch == 'main' }}
uses: EndBug/[email protected]
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: "Bumped version to ${{env.GitVersion_LegacySemVer}}"
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
- name: Setup Yarn
run: npm install --global yarn && yarn
- name: Restore plugin packages
run: dotnet restore
working-directory: src-plugin
- name: Restore client packages
run: yarn install
working-directory: src-client
- name: Build
run: dotnet build -c Release
working-directory: src-plugin
- name: Make EliteVA-plugin
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: mkdir "EliteVA-plugin"
working-directory: src-plugin
- name: Copy to EliteVA-plugin
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: xcopy "EliteVA\bin\Release\net472\" "EliteVA-plugin" /Y /I
working-directory: src-plugin
- name: Add Costura.Fody
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: dotnet add package Costura.Fody
working-directory: src-plugin\EliteVA
- name: Build
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: dotnet build -c Release
working-directory: src-plugin
- name: Copy to EliteVA-plugin
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: xcopy "EliteVA\bin\Release\net472\" "EliteVA-plugin" /Y /I
working-directory: src-plugin
- name: Generate profile
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: dotnet run --project ProfileGenerator -c Release
working-directory: src-plugin
- name: Copy profile
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
run: copy "src-plugin/Profile.vap" "EliteVA.vap"
- name: Zip dist
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: "EliteVA.zip"
path: "src-plugin/EliteVA-plugin/*"
- name: Build updater
run: yarn tauri build
- name: Move updater
run: copy "src-tauri\target\release\EliteVA.exe" "EliteVA-updater.exe"
- name: Release
if: github.ref == 'refs/heads/main' && ${{ steps.VERSION.outputs.applicable == 'true' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.VERSION.outputs.semver }}
files: |
EliteVA.zip
EliteVA.vap
EliteVA-updater.exe
prerelease: ${{ steps.extract_branch.outputs.branch != 'main' }}
draft: true