non-release-build #17
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
| # Workflow that builds the firmware, but doesn't add to a release. | |
| name: non-release-build | |
| # Controls when the workflow will run | |
| on: | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| branches: | |
| env: | |
| FILENAME_PREFIX: OpenLog_Artemis | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Get firmware version 1 | |
| run: | | |
| echo "firmwareMajor=$(grep -Po "(?<=FIRMWARE_VERSION_MAJOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | |
| echo "firmwareMinor=$(grep -Po "(?<=FIRMWARE_VERSION_MINOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | |
| - name: Get firmware version 2 | |
| run: echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" | |
| - name: Run Dockerfile and copy files | |
| run: | | |
| cd ./Firmware | |
| docker build -t openlog_artemis_image --no-cache . | |
| docker create --name=openlog_artemis_container openlog_artemis_image:latest | |
| mkdir ./build | |
| docker cp openlog_artemis_container:/${{ env.FILENAME_PREFIX }}.ino.bin ./build | |
| docker container rm openlog_artemis_container | |
| - name: Rename binary | |
| run: | | |
| cd ./Firmware/build | |
| mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin | |
| echo "targetBinary=./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin" >> "$GITHUB_ENV" | |
| - name: Upload binary to action | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin | |
| path: ${{ env.targetBinary }} |