build-bootstrap #45
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
name: build-bootstrap | |
on: | |
workflow_dispatch: | |
inputs: | |
octoprint-version: | |
description: 'OctoPrint version' | |
default: '1.10.0' | |
type: string | |
build-type: | |
description: Build type | |
type: choice | |
options: | |
- release | |
- pre-release | |
- artifact-only | |
jobs: | |
build-bootstrap: | |
name: Build architecture specific bootstrap | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [x86_64, i686] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Set up QEMU user mode | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r26d | |
add-to-path: true | |
- name: Build bootstrap | |
run: | | |
bash scripts/create-bootstrap.sh ${{ matrix.arch }} ${{ github.event.inputs.octoprint-version }} ${SHORT_SHA} | |
env: | |
NDK_PATH: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bootstrap-${{ env.SHORT_SHA }}-${{ matrix.arch }} | |
path: build/bootstrap-${{ github.event.inputs.octoprint-version }}-${{ matrix.arch }}.zip | |
release: | |
if: ${{ github.event.inputs.build-type != 'artifact-only' }} | |
needs: [build-bootstrap] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: ${{ github.event.inputs.build-type == 'pre-release' }} | |
body: Octo4a bootstrap ${{ env.SHORT_SHA }} bundled with OctoPrint {{ github.event.inputs.octoprint-version }} | |
files: | | |
bootstrap-${{ env.SHORT_SHA }}-i686/bootstrap-${{ github.event.inputs.octoprint-version }}-i686.zip | |
bootstrap-${{ env.SHORT_SHA }}-x86_64/bootstrap-${{ github.event.inputs.octoprint-version }}-x86_64.zip |