-
-
Notifications
You must be signed in to change notification settings - Fork 13
129 lines (125 loc) · 4.64 KB
/
pr-deploy-tests.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: Test Deploy
on:
pull_request:
jobs:
package:
runs-on: ubuntu-22.04
env:
TERM: xterm
strategy:
matrix:
arch:
- x64
- arm64
node-version:
- '16'
os:
- linux
- macos
- win
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile --production
- name: Reset version if needed
run: |
git describe --tags --abbrev=1 && yarn bump "$(git describe --tags --abbrev=1 | cut -c2-)" package.json || echo "No tags yet. Skipping..."
node ./bin/hyperdrive
- name: Package into node binary
uses: lando/pkg-action@v2
with:
entrypoint: bin/hyperdrive
arch: ${{ matrix.arch }}
node-version: node${{ matrix.node-version }}
os: ${{ matrix.os }}
sign-n-deploy:
runs-on: ${{ matrix.os }}
needs:
- package
env:
TERM: xterm
strategy:
matrix:
include:
- os: windows-2022
key: hyperdrive-node16-win-x64-${{ github.sha }}
file: hyperdrive/hyperdrive.exe
certificate-data: WINDOZE_CERT_DATA
certificate-password: WINDOZE_CERT_PASSWORD
result: hyperdrive-win-x64-snapshot-${{ github.sha }}.exe
- os: windows-2022
key: hyperdrive-node16-win-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive.exe
certificate-data: WINDOZE_CERT_DATA
certificate-password: WINDOZE_CERT_PASSWORD
result: hyperdrive-win-arm64-snapshot-${{ github.sha }}.exe
- os: macos-14
key: hyperdrive-node16-macos-x64-${{ github.sha }}
file: hyperdrive/hyperdrive
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.hyperdrive
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: hyperdrive-macos-x64-snapshot-${{ github.sha }}
- os: macos-14
key: hyperdrive-node16-macos-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive
certificate-data: APPLE_CERT_DATA
certificate-password: APPLE_CERT_PASSWORD
apple-product-id: dev.lando.hyperdrive
apple-team-id: FY8GAUX282
apple-notary-user: APPLE_NOTARY_USER
apple-notary-password: APPLE_NOTARY_PASSWORD
options: --options runtime --entitlements entitlements.xml
result: hyperdrive-macos-arm64-snapshot-${{ github.sha }}
- os: ubuntu-22.04
key: hyperdrive-node16-linux-x64-${{ github.sha }}
file: hyperdrive/hyperdrive
result: hyperdrive-linux-x64-snapshot-${{ github.sha }}
- os: ubuntu-22.04
key: hyperdrive-node16-linux-arm64-${{ github.sha }}
file: hyperdrive/hyperdrive
result: hyperdrive-linux-arm64-snapshot-${{ github.sha }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download ${{ matrix.key }}
uses: actions/download-artifact@v3
with:
name: ${{ matrix.key }}
path: hyperdrive
- name: Sign and Notarize
uses: lando/code-sign-action@v2
id: code-sign-action
with:
file: ${{ matrix.file }}
certificate-data: ${{ secrets[matrix.certificate-data] }}
certificate-password: ${{ secrets[matrix.certificate-password] }}
apple-notary-user: ${{ secrets[matrix.apple-notary-user] }}
apple-notary-password: ${{ secrets[matrix.apple-notary-password] }}
apple-product-id: ${{ matrix.apple-product-id }}
apple-team-id: ${{ matrix.apple-team-id }}
options: ${{ matrix.options }}
- name: Rename as needed
shell: bash
run: |
chmod +x ${{ steps.code-sign-action.outputs.file }}
mv ${{ steps.code-sign-action.outputs.file }} ${{ matrix.result }}
- name: Upload snapshot release ${{ matrix.result }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.result }}
path: ${{ matrix.result }}
if-no-files-found: error
retention-days: 1