Skip to content

Extract const for APPROXIMATELY_EVERYTHING (#2462) #1176

Extract const for APPROXIMATELY_EVERYTHING (#2462)

Extract const for APPROXIMATELY_EVERYTHING (#2462) #1176

name: Upload assets to dl.oxide.computer
# Files are at dl.oxide.computer/console/releases/<sha>.tar.gz
on:
push:
branches: [main]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: oxide-downloads
- run: npm install
- name: Build for Nexus
run: SHA=${{ github.sha }} npm run build
- name: Gzip individual files (keep originals)
run: ls dist/assets/*.{js,css,map} | xargs gzip --keep
- name: add console_version file
run: echo ${{ github.sha }} > dist/VERSION
- 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: Upload files to GCP bucket
id: upload-files
uses: google-github-actions/upload-cloud-storage@v2
with:
# weird combo: the path tells it where to find the files, and for some
# reason it takes only the immediate containing folder name and sticks
# it in the destination, so we end up with dl.oxide.computer/releases/console,
# as desired
path: 'releases/console'
destination: 'dl.oxide.computer/releases'
process_gcloudignore: false # we don't have one