Skip to content

Commit 3e00b19

Browse files
committed
ci: use runner.os instead of matrix.os in platform conditions
runner.os is more general than matrix.os for platform detection
1 parent a45e2d8 commit 3e00b19

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

.github/workflows/package.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ jobs:
5050
key: 2022-12-21-${{ runner.os }}-${{ hashFiles('**/yarn.lock')}}
5151

5252
- name: Add msbuild to PATH
53-
if: matrix.os == 'windows-2019'
53+
if: runner.os == 'Windows'
5454
uses: microsoft/setup-msbuild@v2
5555
env:
5656
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
5757

5858
- name: Setup Certificate
59-
if: matrix.os == 'windows-2019'
59+
if: runner.os == 'Windows'
6060
run: |
6161
echo "${{ secrets.SM_CLIENT_CERT_FILE_BASE64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
6262
shell: bash
6363

6464
- name: Set variables
65-
if: matrix.os == 'windows-2019'
65+
if: runner.os == 'Windows'
6666
run: |
6767
echo "SM_KEYPAIR_NAME=${{ secrets.SM_KEYPAIR_ALIAS }}" >> "$GITHUB_ENV"
6868
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
@@ -75,15 +75,15 @@ jobs:
7575
shell: bash
7676

7777
- name: Setting up the client tools
78-
if: ${{ matrix.os == 'windows-2019' && env.SM_API_KEY != '' }}
78+
if: ${{ runner.os == 'Windows' && env.SM_API_KEY != '' }}
7979
run: |
8080
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
8181
msiexec /i smtools-windows-x64.msi /quiet /qn
8282
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
8383
shell: cmd
8484

8585
- name: Certificates Sync
86-
if: ${{ matrix.os == 'windows-2019' && env.SM_API_KEY != '' }}
86+
if: ${{ runner.os == 'Windows' && env.SM_API_KEY != '' }}
8787
run: |
8888
smctl windows certsync
8989
shell: cmd
@@ -109,7 +109,7 @@ jobs:
109109
echo "LOG_ENCRYPTION_PUBLIC_KEY=${{ secrets.LOG_ENCRYPTION_PUBLIC_KEY }}" >> packages/neuron-wallet/.env
110110
111111
- name: Package for MacOS
112-
if: matrix.os == 'macos-latest'
112+
if: runner.os == 'macOS'
113113
run: |
114114
./scripts/download-ckb.sh mac
115115
yarn release mac
@@ -122,7 +122,7 @@ jobs:
122122
TEAM_ID: ${{ secrets.TEAM_ID }}
123123

124124
- name: Package for Windows
125-
if: matrix.os == 'windows-2019'
125+
if: runner.os == 'Windows'
126126
run: |
127127
bash ./scripts/download-ckb.sh win
128128
yarn build
@@ -132,50 +132,50 @@ jobs:
132132
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133133

134134
- name: Package for Linux
135-
if: matrix.os == 'ubuntu-20.04'
135+
if: runner.os == 'Linux'
136136
run: |
137137
./scripts/download-ckb.sh
138138
yarn release linux
139139
env:
140140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141141

142142
- name: Upload Neuron App Zip
143-
if: matrix.os == 'macos-latest'
143+
if: runner.os == 'macOS'
144144
uses: actions/upload-artifact@v4
145145
with:
146146
name: Neuron-Mac-x64
147147
path: release/Neuron-*-mac-x64.zip
148148

149149
- name: Upload Neuron App Zip(arm64)
150-
if: matrix.os == 'macos-latest'
150+
if: runner.os == 'macOS'
151151
uses: actions/upload-artifact@v4
152152
with:
153153
name: Neuron-Mac-arm64
154154
path: release/Neuron-*-mac-arm64.zip
155155

156156
- name: Upload Neuron Dmg
157-
if: matrix.os == 'macos-latest'
157+
if: runner.os == 'macOS'
158158
uses: actions/upload-artifact@v4
159159
with:
160160
name: Neuron-Dmg-x64
161161
path: release/Neuron-*-x64.dmg
162162

163163
- name: Upload Neuron Dmg(arm64)
164-
if: matrix.os == 'macos-latest'
164+
if: runner.os == 'macOS'
165165
uses: actions/upload-artifact@v4
166166
with:
167167
name: Neuron-Dmg-arm64
168168
path: release/Neuron-*-arm64.dmg
169169

170170
- name: Upload Neuron Win
171-
if: matrix.os == 'windows-2019'
171+
if: runner.os == 'Windows'
172172
uses: actions/upload-artifact@v4
173173
with:
174174
name: Neuron-Win
175175
path: release/Neuron-*-setup.exe
176176

177177
- name: Upload Neuron Linux
178-
if: matrix.os == 'ubuntu-20.04'
178+
if: runner.os == 'Linux'
179179
uses: actions/upload-artifact@v4
180180
with:
181181
name: Neuron-Linux

.github/workflows/package_for_test.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ jobs:
9292
key: 2022-12-21-${{ runner.os }}-${{ hashFiles('**/yarn.lock')}}
9393

9494
- name: Add msbuild to PATH
95-
if: matrix.os == 'windows-2019'
95+
if: runner.os == 'Windows'
9696
uses: microsoft/setup-msbuild@v2
9797
env:
9898
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
9999

100100
- name: Setup Certificate
101-
if: matrix.os == 'windows-2019'
101+
if: runner.os == 'Windows'
102102
run: |
103103
echo "${{ secrets.SM_CLIENT_CERT_FILE_BASE64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
104104
shell: bash
105105

106106
- name: Set variables
107-
if: matrix.os == 'windows-2019'
107+
if: runner.os == 'Windows'
108108
run: |
109109
echo "SM_KEYPAIR_NAME=${{ secrets.SM_KEYPAIR_ALIAS }}" >> "$GITHUB_ENV"
110110
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
@@ -117,15 +117,15 @@ jobs:
117117
shell: bash
118118

119119
- name: Setting up the client tools
120-
if: ${{ matrix.os == 'windows-2019' && env.SM_API_KEY != '' }}
120+
if: ${{ runner.os == 'Windows' && env.SM_API_KEY != '' }}
121121
run: |
122122
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
123123
msiexec /i smtools-windows-x64.msi /quiet /qn
124124
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
125125
shell: cmd
126126

127127
- name: Certificates Sync
128-
if: ${{ matrix.os == 'windows-2019' && env.SM_API_KEY != '' }}
128+
if: ${{ runner.os == 'Windows' && env.SM_API_KEY != '' }}
129129
run: |
130130
smctl windows certsync
131131
shell: cmd
@@ -154,7 +154,7 @@ jobs:
154154
fs.writeFileSync(ympPath, fs.readFileSync(ympPath).toString().replace('asar: true', 'asar: false'))
155155
156156
- name: Package for MacOS
157-
if: ${{ matrix.os == 'macos-latest' && env.MAC_SHOULD_CODE_SIGN == 'true' }}
157+
if: ${{ runner.os == 'macOS' && env.MAC_SHOULD_CODE_SIGN == 'true' }}
158158
run: |
159159
./scripts/download-ckb.sh mac
160160
yarn package:test mac
@@ -168,7 +168,7 @@ jobs:
168168
USE_HARD_LINKS: false
169169

170170
- name: Package for MacOS for skip code sign
171-
if: ${{ matrix.os == 'macos-latest' && env.MAC_SHOULD_CODE_SIGN == 'false' }}
171+
if: ${{ runner.os == 'macOS' && env.MAC_SHOULD_CODE_SIGN == 'false' }}
172172
run: |
173173
export CSC_IDENTITY_AUTO_DISCOVERY=false
174174
./scripts/download-ckb.sh mac
@@ -179,7 +179,7 @@ jobs:
179179
USE_HARD_LINKS: false
180180

181181
- name: Package for Windows
182-
if: matrix.os == 'windows-2019'
182+
if: runner.os == 'Windows'
183183
run: |
184184
bash ./scripts/download-ckb.sh win
185185
yarn build
@@ -189,7 +189,7 @@ jobs:
189189
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190190

191191
- name: Package for Linux
192-
if: matrix.os == 'ubuntu-20.04'
192+
if: runner.os == 'Linux'
193193
run: |
194194
./scripts/download-ckb.sh
195195
yarn package:test linux
@@ -198,42 +198,42 @@ jobs:
198198
USE_HARD_LINKS: false
199199

200200
- name: Upload Neuron App Zip
201-
if: matrix.os == 'macos-latest'
201+
if: runner.os == 'macOS'
202202
uses: actions/upload-artifact@v4
203203
with:
204204
name: Neuron-Mac-x64
205205
path: release/Neuron-*-mac-x64.zip
206206

207207
- name: Upload Neuron App Zip(arm64)
208-
if: matrix.os == 'macos-latest'
208+
if: runner.os == 'macOS'
209209
uses: actions/upload-artifact@v4
210210
with:
211211
name: Neuron-Mac-arm64
212212
path: release/Neuron-*-mac-arm64.zip
213213

214214
- name: Upload Neuron Dmg
215-
if: matrix.os == 'macos-latest'
215+
if: runner.os == 'macOS'
216216
uses: actions/upload-artifact@v4
217217
with:
218218
name: Neuron-Dmg-x64
219219
path: release/Neuron-*-x64.dmg
220220

221221
- name: Upload Neuron Dmg(arm64)
222-
if: matrix.os == 'macos-latest'
222+
if: runner.os == 'macOS'
223223
uses: actions/upload-artifact@v4
224224
with:
225225
name: Neuron-Dmg-arm64
226226
path: release/Neuron-*-arm64.dmg
227227

228228
- name: Upload Neuron Win
229-
if: matrix.os == 'windows-2019'
229+
if: runner.os == 'Windows'
230230
uses: actions/upload-artifact@v4
231231
with:
232232
name: Neuron-Win
233233
path: release/Neuron-*-setup.exe
234234

235235
- name: Upload Neuron Linux
236-
if: matrix.os == 'ubuntu-20.04'
236+
if: runner.os == 'Linux'
237237
uses: actions/upload-artifact@v4
238238
with:
239239
name: Neuron-Linux

0 commit comments

Comments
 (0)