|
| 1 | +name: Build Rubik PI Image |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main, rubik-pi] |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4.1.7 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + - name: Download image |
| 19 | + run: | |
| 20 | + wget https://thundercomm.s3.ap-northeast-1.amazonaws.com/uploads/web/rubik-pi-3/20250331/FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001.zip |
| 21 | + unzip FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001.zip |
| 22 | + rm FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001.zip |
| 23 | + - uses: pguyot/arm-runner-action@HEAD |
| 24 | + id: install_deps |
| 25 | + with: |
| 26 | + image_additional_mb: 1500 |
| 27 | + bind_mount_repository: true |
| 28 | + base_image: FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001/ufs/system.img |
| 29 | + commands: | |
| 30 | + chmod +x ./install_rubik.sh |
| 31 | + ./install_rubik.sh |
| 32 | + chmod +x ./install_common.sh |
| 33 | + ./install_common.sh |
| 34 | + mkdir -p /opt/photonvision/ |
| 35 | + echo "${{ github.ref_name }};rubik3" > /opt/photonvision/image-version |
| 36 | +
|
| 37 | + - name: Compress built image |
| 38 | + run: | |
| 39 | + mv -f ${{ steps.install_deps.outputs.image }} FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001/ufs/system.img |
| 40 | + zip -r photonvision_rubik.zip FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001 |
| 41 | + rm -rf FlatBuild_RUBIKPi-3_xx.xx_Debian13.R.debug.ES.r000001 |
| 42 | +
|
| 43 | + - uses: actions/upload-artifact@v4.3.4 |
| 44 | + with: |
| 45 | + name: photonvision_rubik.zip |
| 46 | + path: photonvision_rubik.zip |
| 47 | + if-no-files-found: error |
| 48 | + retention-days: 1 |
| 49 | + |
| 50 | + release: |
| 51 | + needs: [build] |
| 52 | + runs-on: ubuntu-22.04 |
| 53 | + steps: |
| 54 | + # Download literally every single artifact |
| 55 | + - uses: actions/download-artifact@v4.1.8 |
| 56 | + - run: find |
| 57 | + # Push to dev release |
| 58 | + - uses: pyTooling/Actions/releaser@v1.0.5 |
| 59 | + with: |
| 60 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + tag: "Dev" |
| 62 | + rm: true |
| 63 | + files: | |
| 64 | + **/*.zip |
| 65 | + if: github.event_name == 'push' |
| 66 | + # Upload archive to GH tag if tagged |
| 67 | + - uses: softprops/action-gh-release@v2.0.8 |
| 68 | + with: |
| 69 | + files: | |
| 70 | + **/*.zip |
| 71 | + if: startsWith(github.ref, 'refs/tags/v') |
| 72 | + env: |
| 73 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments