-
Notifications
You must be signed in to change notification settings - Fork 45
102 lines (90 loc) · 3.59 KB
/
deploy-installers.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
name: Deploy Installers
on:
push:
branches:
- master
jobs:
installer-matrix:
strategy:
matrix:
os: [ "macos-latest", "windows-latest" ]
runs-on: ${{ matrix.os }}
env:
ORG_GRADLE_PROJECT_GITHUB_USERNAME: ${{ github.actor }}
ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_snapshotUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_snapshotPassword: ${{ secrets.NEXUS_PASSWORD }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17.0.2'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build bootstrap and package
run: |
./gradlew editor-desktop-bootstrap:dist
- name: Build Mac
if: runner.os == 'macOS'
run: |
cd editor-desktop-bootstrap
./package-mac.sh
- name: Upload installer for Mac
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: mac-installer
path: editor-desktop-bootstrap/target/talos/TalosVFX-1.0.pkg
- name: import windows certificate
if: runner.os == 'Windows'
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
Remove-Item -path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
- name: Build Windows
if: runner.os == 'Windows'
run: |
cd editor-desktop-bootstrap
bash ./package-win.sh
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe" sign /tr http://timestamp.digicert.com /sha1 69B0E38B4AE92DA8F0433A154D0ED12BD735BF91 /d "TalosVFX Installer" target/talos/TalosVFX-1.0.msi
- name: Upload installer for windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: win-installer
path: editor-desktop-bootstrap/target/talos/TalosVFX-1.0.msi
upload:
needs: installer-matrix
name: Upload installer binaries
runs-on: ubuntu-latest
steps:
- name: Download Mac installer
uses: actions/download-artifact@v3
with:
name: mac-installer
- name: Download Windows installers
uses: actions/download-artifact@v3
with:
name: win-installer
- name: Print the final result
run: ls
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_SERVER }} >> ~/.ssh/known_hosts
- name: Deploy binaries with scp
run: |
scp TalosVFX-1.0.msi ${{secrets.SSH_SERVER_USER }}@${{secrets.SSH_SERVER }}:/var/www/editor.talosvfx.com/installers
scp TalosVFX-1.0.pkg ${{secrets.SSH_SERVER_USER }}@${{secrets.SSH_SERVER }}:/var/www/editor.talosvfx.com/installers