Build a Custom Spotty for a specific platform #15
This file contains hidden or 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
| name: Build a Custom Spotty for a specific platform | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| target_triple: | |
| description: 'Target Triple (see https://github.com/cross-rs/cross#supported-targets)' | |
| required: true | |
| default: 'arm-unknown-linux-musleabi' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| KEYMASTER_CLIENT_ID: ${{ secrets.KEYMASTER_CLIENT_ID }} | |
| jobs: | |
| Custom-Build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Update and Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y build-essential cmake libclang1 | |
| - name: Install bindgen-cli | |
| run: cargo install --force --locked bindgen-cli | |
| - name: Write Build Configuration File | |
| uses: DamianReeves/write-file-action@v1.3 | |
| with: | |
| path: ./src/client_id.txt | |
| contents: ${{ env.KEYMASTER_CLIENT_ID }} | |
| write-mode: overwrite | |
| - name: Prepare build environment | |
| run: | | |
| curl -L https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz | tar xvz | |
| mkdir -p releases | |
| - name: Build | |
| run: | | |
| ./cross build --release --target=${{ github.event.inputs.target_triple }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: spotty-custom | |
| path: target/${{ github.event.inputs.target_triple }}/release/spotty | |
| - run: | | |
| echo 'Build succeeded for `${{ github.event.inputs.target_triple }}`' >> $GITHUB_STEP_SUMMARY |