-
Notifications
You must be signed in to change notification settings - Fork 1
209 lines (168 loc) · 6.49 KB
/
build.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Build
on:
push:
branches: [ main ]
workflow_dispatch:
env:
VERSION: 1.0.7
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Git user
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "<>"
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
build-windows:
needs: setup
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./Windows/CaptureWolf.sln
- name: Setup VS Dev Environment
uses: seanmiddleditch/gha-setup-vsdevenv@v4
- name: Update version in .vdproj file
run: |
$content = Get-Content -Path ./Windows/CaptureWolf.Installer/CaptureWolf.Installer.vdproj -Raw
$content = $content -replace '(?<=ProductVersion" = "8:)\d+\.\d+\.\d+', '${{ env.VERSION }}'
Set-Content -Path ./Windows/CaptureWolf.Installer/CaptureWolf.Installer.vdproj -Value $content
shell: pwsh
- name: Build
run: dotnet build --configuration Release --no-restore ./Windows/CaptureWolf.Form/CaptureWolf.UI.csproj
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: windows-standalone
path: ./Windows/CaptureWolf.Form/bin/Release/
- name: Build Installer
run: devenv.com ./Windows/CaptureWolf.Installer/CaptureWolf.Installer.vdproj /build "Release|Any CPU"
- name: Upload Installer
uses: actions/upload-artifact@v2
with:
name: windows-installer
path: ./Windows/CaptureWolf.Installer/Release/
- name: Commit version bump
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./Windows/CaptureWolf.Installer/CaptureWolf.Installer.vdproj
git commit -m "Bump version to ${{ env.VERSION }}"
shell: bash
build-osx:
needs: setup
runs-on: macos-14
defaults:
run:
working-directory: ${{ github.workspace }}/OSX
permissions:
contents: write
steps:
- name: Checkout files
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21
- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"
- name: Select XCode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '15.2.0'
- name: Create Cert folder
run: mkdir -p cert
- name: Decode signing certificate into a file
env:
CERTIFICATE_BASE64: ${{ secrets.SIGNING_CERT }}
run: echo $CERTIFICATE_BASE64 | base64 --decode > ./cert/signing-cert.cer
- name: Decode signing key into a file
env:
KEY_BASE64: ${{ secrets.SIGNING_KEY }}
run: echo $KEY_BASE64 | base64 --decode > ./cert/signing-key.p12
- name: Install dependencies
run: bundle install
- name: Bump ios version
uses: yanamura/ios-bump-version@v1
with:
version: ${{ env.VERSION }}
project-path: OSX
- name: Deploy app
run: bundle exec fastlane mac release --verbose
env:
SIGNING_CERT_PASSWORD: ${{ secrets.SIGNING_CERT_PASSWORD }}
SIGNING_CERT_FILE_PATH: ./cert/signing-cert.cer
SIGNING_KEY_FILE_PATH: ./cert/signing-key.p12
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: osx-installer
path: ./OSX/release/
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
create-release:
needs: [build-windows, build-osx]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Generate release notes
id: release_notes
run: |
PREV_VERSION=$(awk -F. -v version="${{ env.VERSION }}" 'BEGIN { OFS = "."; } { $NF--; print $0; }' <<< version)
echo "::set-output name=body::**Full Changelog**: https://github.com/galadril/CaptureWolf/compare/v${PREV_VERSION}...v${{ env.VERSION }}\n\n### ⬇️ Downloads:\n**Windows**\n* [🖥️ Standalone](https://github.com/galadril/CaptureWolf/files/${{ steps.create_release.outputs.id }}/windows-standalone.zip)\n* [💾 Installer](https://github.com/galadril/CaptureWolf/files/${{ steps.create_release.outputs.id }}/windows-installer.zip)\n\n**macOS**\n* [🍎 Installer](https://github.com/galadril/CaptureWolf/files/${{ steps.create_release.outputs.id }}/osx-installer.zip)"
shell: bash
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: false
prerelease: false
body: ${{ steps.release_notes.outputs.body }}
- name: Upload Release Asset (Windows Standalone)
id: upload-release-asset-windows-standalone
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/windows-standalone.zip
asset_name: windows-standalone.zip
asset_content_type: application/zip
- name: Upload Release Asset (Windows Installer)
id: upload-release-asset-windows-installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/windows-installer.zip
asset_name: windows-installer.zip
asset_content_type: application/zip
- name: Upload Release Asset
id: upload-release-asset-osx
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/osx-installer.zip
asset_name: osx-installer.zip
asset_content_type: application/zip