Encoder for T330 collar (#322) #1435
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [getvars, 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-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }} | |
# Upload firmware to CDN. | |
- uses: ./.github/actions/cdn-upload-firmware | |
with: | |
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }} | |
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }} | |
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }} | |
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-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }} | |
# Upload firmware to CDN. | |
- uses: ./.github/actions/cdn-upload-version-info | |
with: | |
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }} | |
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }} | |
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }} | |
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-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }} | |
# Upload firmware to CDN. | |
- uses: ./.github/actions/cdn-bump-version | |
with: | |
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }} | |
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }} | |
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }} | |
bunny-api-key: ${{ secrets.BUNNY_APIKEY }} | |
bunny-cdn-url: ${{ vars.BUNNY_CDN_URL }} | |
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 }} |