-
Notifications
You must be signed in to change notification settings - Fork 850
153 lines (147 loc) · 6.09 KB
/
nightly-rainforest.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
name: nightly-rainforest
on:
workflow_call:
inputs:
tag:
description: "Reference tag of the nightly build"
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: "Reference tag of the nightly build"
required: true
type: string
defaults:
run:
shell: bash
env:
TERM: xterm
MM_DESKTOP_BUILD_DISABLEGPU: true
MM_DESKTOP_BUILD_SKIPONBOARDINGSCREENS: true
MM_WIN_INSTALLERS: 1
REFERENCE: ${{ inputs.tag }}
jobs:
build-msi-installer:
runs-on: windows-2022
steps:
- name: nightly/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ env.REFERENCE }}
- name: nightly/setup-node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: "package.json"
cache: "npm"
cache-dependency-path: package-lock.json
- name: nightly/install-deps
shell: powershell
run: |
choco install yq --version 4.15.1 -y
npm i -g node-gyp
node-gyp install
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64
npm ci --openssl_fips=''
- name: nightly/test
uses: ./.github/actions/test
- name: nightly/build
shell: powershell
env:
MM_WIN_INSTALLERS: 1
PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }}
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }}
PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }}
CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }}
run: npm run package:windows-installers
- name: nightly/package
run: |
mkdir -p ./build/win
bash -x ./scripts/patch_updater_yml.sh
bash -x ./scripts/cp_artifacts.sh release ./build/win
- name: nightly/upload-build
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: build-rainforest-${{ runner.os }}
path: ./build
compression-level: 0
retention-days: 5 ## No need to keep them since they are uploaded on S3
build-mac-installer:
runs-on: macos-15
steps:
- name: nightly/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ env.REFERENCE }}
- name: nightly/setup-node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: "package.json"
cache: "npm"
cache-dependency-path: package-lock.json
- name: nightly/install-dependencies
run: |
brew install yq rename
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
npm ci
- name: nightly/test
uses: ./.github/actions/test
- name: nightly/build
env:
APPLE_API_KEY_ID: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY_ID }}
APPLE_API_KEY_RAW: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY }}
APPLE_API_KEY: "./key.p8"
APPLE_API_ISSUER: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_ISSUER_ID }}
CSC_FOR_PULL_REQUEST: true
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_LINK }}
MAC_PROFILE: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_DMG_PROFILE }}
run: |
echo $MAC_PROFILE | base64 -D > ./mac.provisionprofile
zsh -c 'echo -n $APPLE_API_KEY_RAW > ./key.p8'
mkdir -p ./build/macos
npm run package:mac-with-universal
bash -x ./scripts/patch_updater_yml.sh
bash -x ./scripts/cp_artifacts.sh release ./build/macos
- name: nightly/rename-arm64-to-m1
run: rename 's/arm64/m1/' ./build/macos/$(jq -r .version package.json)/*
- name: nightly/upload-build
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: build-rainforest-${{ runner.os }}
path: ./build
compression-level: 0
retention-days: 5 ## No need to keep them since they are uploaded on S3
upload-to-s3-daily:
runs-on: ubuntu-22.04
needs:
- build-mac-installer
- build-msi-installer
steps:
- name: nightly/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ env.REFERENCE }}
- name: nightly/setup-aws-credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.MM_DESKTOP_DAILY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.MM_DESKTOP_DAILY_AWS_SECRET_ACCESS_KEY }}
- name: nightly/download-builds
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
path: build
pattern: build-rainforest-*
merge-multiple: true
- name: nightly/install-missing-deps
run: |
sudo apt-get update
sudo apt-get install rename jq -y
- name: nightly/setup-files-for-aws
run: |
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/macos/$(jq -r .version package.json)/*
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/win/$(jq -r .version package.json)/*
- name: nightly/upload-to-s3
run: aws s3 cp ./build/ s3://mattermost-desktop-daily-builds/ --acl public-read --cache-control "no-cache" --recursive