Skip to content

fix variable usage #1376

fix variable usage

fix variable usage #1376

Workflow file for this run

on:
push:
branches:
- master
- beta
- develop
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
branches:
- master
- beta
- develop
types: [opened, reopened, synchronize]
workflow_dispatch: # Manually invoked by user.
name: ci-build
env:
PNPM_VERSION: 9
NODE_VERSION: 20
PYTHON_VERSION: 3.12
jobs:
getvars:
uses: ./.github/workflows/get-vars.yml
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
frontend
- uses: ./.github/actions/build-frontend
with:
pnpm-version: ${{ env.PNPM_VERSION }}
node-version: ${{ env.NODE_VERSION }}
build-staticfs:
runs-on: ubuntu-latest
needs: build-frontend
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-staticfs
with:
version: ${{ needs.getvars.outputs.version }}
skip-checkout: true
build-firmware:
needs: [getvars]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.getvars.outputs.board-matrix) }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-firmware
with:
board: ${{ matrix.board }}
version: ${{ needs.getvars.outputs.version }}
skip-checkout: true
merge-partitions:
needs: [getvars, build-staticfs, build-firmware]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.getvars.outputs.board-matrix) }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
scripts
boards
chips
- uses: ./.github/actions/merge-partitions
with:
version: ${{ needs.getvars.outputs.version }}
board: ${{ matrix.board }}
skip-checkout: true
checkpoint-build:
runs-on: ubuntu-latest
needs: [merge-partitions]
steps:
- run: echo "Builds checkpoint reached"
cdn-upload-firmware:
needs: [getvars, checkpoint-build]
if: ${{ needs.getvars.outputs.should-deploy == 'true' }}
runs-on: ubuntu-latest
environment: cdn-firmware-r2
strategy:
fail-fast: true
matrix: ${{ fromJson(needs.getvars.outputs.board-matrix) }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-port: ${{ vars.BUNNY_STOR_PORT }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
# Upload firmware to CDN.
- uses: ./.github/actions/cdn-upload-firmware
with:
fw-version: ${{ needs.getvars.outputs.version }}
board: ${{ matrix.board }}
cdn-upload-version-info:
needs: [getvars, checkpoint-build]
if: ${{ needs.getvars.outputs.should-deploy == 'true' }}
runs-on: ubuntu-latest
environment: cdn-firmware-r2
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-port: ${{ vars.BUNNY_STOR_PORT }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
# Upload firmware to CDN.
- uses: ./.github/actions/cdn-upload-version-info
with:
fw-version: ${{ needs.getvars.outputs.version }}
release-channel: ${{ needs.getvars.outputs.release-channel }}
boards: ${{ needs.getvars.outputs.board-list }}
cdn-bump-version:
runs-on: ubuntu-latest
needs: [getvars, cdn-upload-firmware] # only after version is complete
environment: cdn-firmware-r2
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-port: ${{ vars.BUNNY_STOR_PORT }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
# Upload firmware to CDN.
- uses: ./.github/actions/cdn-bump-version
with:
version: ${{ needs.getvars.outputs.version }}
release-channel: ${{ needs.getvars.outputs.release-channel }}
checkpoint-cdn:
runs-on: ubuntu-latest
needs: [cdn-upload-firmware, cdn-upload-version-info, cdn-bump-version]
steps:
- run: echo "CDN checkpoint reached"
release:
needs: [getvars, checkpoint-cdn]
if: (needs.getvars.outputs.release-channel == 'stable' || needs.getvars.outputs.release-channel == 'beta')
runs-on: ubuntu-latest
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
- name: Display artifacts
run: ls -R
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: '**/OpenShock_*.bin'
tag: ${{ needs.getvars.outputs.version }}
prerelease: ${{ needs.getvars.outputs.release-channel != 'stable' }}
artifactErrorsFailBuild: true
body: ${{ needs.getvars.outputs.release-notes }}