forked from sparrowapp-dev/sparrow-app
-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (183 loc) Β· 9.5 KB
/
feat-sparrow-refactoring.yaml
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
210
211
212
213
214
215
216
217
name: feat/web-app-testing
on:
push:
branches:
- feat/web-app-testing
workflow_dispatch:
env:
VITE_API_URL: ${{ secrets.VITE_API_URL_DEV }}
VITE_MIX_PANEL_TOKEN: ${{ secrets.VITE_MIX_PANEL_TOKEN }}
VITE_ENABLE_MIX_PANEL: ${{ secrets.VITE_ENABLE_MIX_PANEL_DEV }}
VITE_API_TIMEOUT: ${{ secrets.VITE_API_TIMEOUT }}
VITE_SPARROW_SUPPORT_EMAIL: ${{ secrets.VITE_SPARROW_SUPPORT_EMAIL }}
VITE_AUTH_URL: ${{ secrets.VITE_AUTH_URL_DEV }}
VITE_SPARROW_GITHUB: ${{ secrets.VITE_SPARROW_GITHUB }}
VITE_SPARROW_DOWNLOAD_LINK: ${{ secrets.VITE_SPARROW_DOWNLOAD_LINK }}
VITE_RELEASE_NOTES_PAT_TOKEN: ${{ secrets.VITE_RELEASE_NOTES_PAT_TOKEN }}
VITE_RELEASE_NOTES_API: ${{ vars.VITE_RELEASE_NOTES_API }}
VITE_AZURE_CDN_URL: ${{ vars.VITE_AZURE_CDN_URL }}
VITE_AZURE_INSIGHTS_CONNECTION_STRING: ${{ vars.VITE_AZURE_INSIGHTS_CONNECTION_STRING }}
VITE_CANNY_API: ${{ vars.VITE_CANNY_API }}
VITE_CANNY_URL: ${{ vars.VITE_CANNY_URL }}
VITE_BASE_URL: ${{ vars.VITE_BASE_URL }}
VITE_SPARROW_LINKEDIN: ${{ vars.VITE_SPARROW_LINKEDIN }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
release_win:
runs-on: windows-latest
environment: development
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
- name: Install Windows SDK
run: Invoke-WebRequest -Uri https://aka.ms/winsdk/10/latest/SdkSetup.exe -OutFile $env:TEMP\SdkSetup.exe
shell: powershell
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1
- name: Install Rust 1.76.0
run: |
Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe
.\rustup-init.exe -y
rustup install 1.76.0
rustup default 1.76.0
- name: Update updater endpoint in tauri.conf.json file
run: |
$content = Get-Content apps/@sparrow-desktop/src-tauri/tauri.conf.json -Raw
$newContent = $content -replace '"https://{{UPDATER_URL}}/updater/{{target}}/{{arch}}/{{current_version}}"', '"https://${{ secrets.UPDATER_ENDPOINT_DEV }}/updater/{{target}}/{{arch}}/{{current_version}}"'
Set-Content -Path apps/@sparrow-desktop/src-tauri/tauri.conf.json -Value $newContent
shell: pwsh
- name: Build Tauri App
run: |
yarn cache clean
npm install -g pnpm
yarn install
yarn desktop-build
# yarn tauri build --debug
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}
- name: msi sig
run: Get-Content D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\msi\*.sig
- name: nsis sig
run: Get-Content D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\nsis\*.sig
- name: sign msi
run: |
$cert = New-SelfSignedCertificate -Subject "CN=Certificate" -CertStoreLocation "Cert:\LocalMachine\My" -KeyUsage DigitalSignature -Type CodeSigningCert -KeySpec Signature -NotAfter (Get-Date).AddDays(90)
$certPath = "Cert:\LocalMachine\My\$($cert.Thumbprint)"
$password = ConvertTo-SecureString -String "sparrow123" -Force -AsPlainText
Export-PfxCertificate -Cert $certPath -FilePath "D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\Certificate.pfx" -Password $password
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\SignTool.exe" sign /f "D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\Certificate.pfx" /p sparrow123 /tr http://timestamp.digicert.com /td sha256 /fd sha256 /v "D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\msi\*.msi"
- name: Install AWS CLI
uses: chrislennon/action-aws-cli@v1.1
with:
version: latest
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload files to S3
run: |
aws s3 sync D:\a\sparrow-app\sparrow-app\apps\@sparrow-desktop\src-tauri\target\release\bundle\msi s3://sparrow-release-assests-dev --exclude "*" --include "*.zip" --include "*.msi"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
release_macos:
runs-on: macos-latest
environment: development
needs: release_win
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Rust 1.76.0
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup install 1.76.0
rustup default 1.76.0
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: '20.8'
- name: Update updater endpoint in tauri.conf.json file
run: |
content=$(<apps/@sparrow-desktop/src-tauri/tauri.conf.json)
newContent=$(echo "$content" | sed 's|"https://{{UPDATER_URL}}/updater/{{target}}/{{arch}}/{{current_version}}"|"https://${{ secrets.UPDATER_ENDPOINT_DEV }}/updater/{{target}}/{{arch}}/{{current_version}}"|g')
echo "$newContent" > apps/@sparrow-desktop/src-tauri/tauri.conf.json
shell: bash
- name: Build Tauri App
run: |
yarn install
yarn tauri build --debug
env:
APPLE_SIGNING_IDENTITY: "${{ secrets.APPLE_SIGNING_IDENTITY }}"
APPLE_CERTIFICATE: "${{ secrets.APPLE_CERTIFICATE }}"
APPLE_CERTIFICATE_PASSWORD: "${{ secrets.APPLE_CERTIFICATE_PASSWORD }}"
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: file content
run: cat /Users/runner/work/sparrow-app/sparrow-app/apps/@sparrow-desktop/src-tauri/target/debug/bundle/macos/*.sig
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
aws --version
- name: Upload & downlode File to S3
run: |
aws s3 cp /Users/runner/work/sparrow-app/sparrow-app/apps/@sparrow-desktop/src-tauri/target/debug/bundle/macos s3://sparrow-release-assests-dev --recursive --exclude "*" --include "*.gz"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Download MSI files from S3 bucket
run: |
mkdir msi_files
aws s3 cp s3://sparrow-release-assests-dev/ msi_files/ --recursive --exclude "*" --include "*.msi"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install App Center CLI
run: |
npm install -g appcenter-cli@latest
- name: Get PR Branch Name
id: pr_branch
run: echo "::set-output name=branch::$(echo ${{ github.head_ref }})"
- name: Upload to App Center
run: |
appcenter login --token ${{ secrets.APPCENTER_API_TOKEN }}
branch_name="${{ steps.pr_branch.outputs.branch }}"
echo "Branch Name: $branch_name"
appcenter distribute release -f /Users/runner/work/sparrow-app/sparrow-app/apps/@sparrow-desktop/src-tauri/target/debug/bundle/dmg/*.dmg -g Collaborators --app techdome/Sparrow-1 --build-version test-${branch_name} --build-number ${{ github.run_number }}
appcenter distribute release -f msi_files/*.msi -g Collaborators --app techdome/Sparrow --build-version test-${branch_name} --build-number ${{ github.run_number }}
- name: status check and upload
uses: neonidian/teams-notify-build-status@v3
if: always()
with:
webhookUrl: |
${{ secrets.TEAMS_INCOMING_WEBHOOK_URL }}
message: |
π **Build Status Update** π
The workflow (sparrow-app for **Mac**) has completed with status: **${{ job.status }}**.
π Check it out latest release here for feat/sparrow-refactoring branch [AppCenter](https://appcenter.ms/users/techdome/apps/Sparrow-mac)!
titleBackgroundColor: ${{ job.status }}
env:
SHOULD_DISPLAY_VIEW_COMMIT_BUTTON: true
- name: status check and upload
uses: neonidian/teams-notify-build-status@v3
if: always()
with:
webhookUrl: |
${{ secrets.TEAMS_INCOMING_WEBHOOK_URL }}
message: |
π **Build Status Update** π
The workflow (sparrow-app for windows) has completed with status: **${{ job.status }}**.
π Check it out latest release here for feat/sparrow-refactoring branch [AppCenter](https://appcenter.ms/users/techdome/apps/Sparrow)!
titleBackgroundColor: ${{ job.status }}
env:
SHOULD_DISPLAY_VIEW_COMMIT_BUTTON: true