-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (41 loc) · 1.54 KB
/
upload-assets.yaml
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
name: Upload assets to dl.oxide.computer
# Files are at dl.oxide.computer/console/releases/<sha>.tar.gz
# Latest main is at dl.oxide.computer/console/releases/main.tar.gz
on:
push:
branches: [main]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
- name: Set up Cloud SDK
uses: google-github-actions/[email protected]
with:
project_id: oxide-downloads
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
- run: yarn install
- name: Build for Nexus
run: yarn build-for-nexus
- run: mkdir -p releases/console
- name: Make <sha>.tar.gz
run: tar czf releases/console/${{ github.sha }}.tar.gz --directory=dist .
- name: Write sha256sum to file
run: sha256sum releases/console/${{ github.sha }}.tar.gz | awk '{print $1}' > releases/console/${{ github.sha }}.sha256.txt
- name: Copy files to main.*
run: |
cp releases/console/${{ github.sha }}.tar.gz releases/console/main.tar.gz
cp releases/console/${{ github.sha }}.sha256.txt releases/console/main.sha256.txt
- name: Upload files to GCP bucket
id: upload-files
uses: google-github-actions/[email protected]
with:
path: 'releases/console'
destination: 'dl.oxide.computer'