-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (112 loc) · 3.58 KB
/
secure-browser-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
121
122
123
124
125
126
127
128
129
name: Build/release Desktop app
on:
push:
branches:
- main
repository_dispatch:
types: [trigger-action]
jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
node-version: 20
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
default_bump: minor
tag_prefix: ""
release:
needs: create-tag
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.APP_REPO }}
token: ${{ env.GH_TOKEN }}
path: 'app'
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Dependencies
run: |-
cd app
npm install
- name: Link API Client Package
run: |-
cd app/packages/api-client
npm link
- name: Install Electron Dependencies
run: |-
cd app/desktop-app
npm install
npm link @packages/api-client
- name: build-linux
if: matrix.os == 'ubuntu-latest'
run: |-
cd app/desktop-app
npm run build:linux
- name: build-mac
if: matrix.os == 'macos-latest'
run: |-
cd app/desktop-app
npm run build:mac
- name: build-win
if: matrix.os == 'windows-latest'
run: |-
cd app/desktop-app
npm run build:win
# latest -> lae -> dist
- name: Remove spaces in file names - (mac & linux)
if: matrix.os != 'windows-latest'
run: |
cd app/desktop-app
mkdir -p formatted-dist
for file in dist/*; do
mv "$file" "formatted-dist/$(echo $file | tr ' ' '-' | sed 's|dist/||')"
done
- name: Remove spaces in file names - (windows)
if: matrix.os == 'windows-latest'
run: |
cd app\desktop-app
mkdir formatted-dist -ErrorAction Ignore
Get-ChildItem dist\* -File | ForEach-Object {
$newName = $_.Name -replace ' ', '-'
Move-Item $_.FullName -Destination ("formatted-dist\" + $newName)
}
shell: pwsh
- name: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.create-tag.outputs.new_tag }}
name: Release ${{ needs.create-tag.outputs.new_tag }}
body: 'Changes in this Release: ${{ needs.create-tag.outputs.changelog }}'
token: ${{ env.GH_TOKEN }}
draft: false
prerelease: false
files: |
app/desktop-app/formatted-dist/*.exe
app/desktop-app/formatted-dist/*.zip
app/desktop-app/formatted-dist/*.dmg
app/desktop-app/formatted-dist/*.AppImage
app/desktop-app/formatted-dist/*.snap
app/desktop-app/formatted-dist/*.exe
app/desktop-app/formatted-dist/*.deb
app/desktop-app/formatted-dist/*.rpm
app/desktop-app/formatted-dist/*.tar.gz
app/desktop-app/formatted-dist/*.yml
app/desktop-app/formatted-dist/*.blockmap