FujiNet Tagged Version Release #10
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: "FujiNet Tagged Version Release" | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag name to use (e.g., v1.0.0)" | |
| required: true | |
| type: string | |
| jobs: | |
| tagged-release: | |
| name: "Tagged Release" | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| matrix: | |
| target-platform: [ATARI, ATARI-8mb, ADAM, APPLE, COCO, IEC-LOLIN-D32, MASTERIES-REVAB, MASTERIES-REVA-SPIFIX] | |
| env: | |
| TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }} | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.TAG_NAME }} | |
| fetch-depth: 0 | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12.1' | |
| - name: Install PlatformIO | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools | |
| pip install --upgrade platformio | |
| pip install Jinja2 | |
| pip install pyyaml | |
| - name: Show python version | |
| run: python --version | |
| - name: Show pio system info | |
| run: pio system info | |
| - name: Show pio location | |
| run: pip show platformio | |
| - name: Create PlatformIO INI for Build | |
| run: cd /home/runner/work/fujinet-firmware/fujinet-firmware && /usr/bin/bash ./build.sh -l /home/runner/work/fujinet-firmware/fujinet-firmware/.github/workflows/platformio.release-${{ matrix.target-platform }}.ini -i /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
| - name: Show platformio.ini | |
| run: cat /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
| - name: Get PIO build_board from INI | |
| id: build_board | |
| shell: bash | |
| run: | | |
| echo "NAME=$(grep '^[^;]*build_board ' /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | sed s'/ //'g | cut -d "=" -f 2 | cut -d ";" -f 1)" >> $GITHUB_OUTPUT | |
| - name: Build release | |
| run: cd /home/runner/work/fujinet-firmware/fujinet-firmware && /usr/bin/bash ./build.sh -z -l /home/runner/work/fujinet-firmware/fujinet-firmware/.github/workflows/platformio.release-${{ matrix.target-platform }}.ini -i /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
| - name: Get version number from release.json | |
| id: release-ver | |
| shell: bash | |
| run: | | |
| echo "VERSION=$(cat firmware/release.json | grep '\"version\"' | cut -d '"' -f 4)" >> $GITHUB_OUTPUT | |
| - name: Show Release Version | |
| run: echo "Release version from JSON - ${{ steps.release-ver.outputs.VERSION }}" | |
| shell: bash | |
| - name: Rename firmware file if needed | |
| shell: bash | |
| run: | | |
| shopt -s nullglob | |
| dest="firmware/fujinet-${{ matrix.target-platform }}-${{ env.TAG_NAME }}.zip" | |
| files=(firmware/fujinet-*.zip) | |
| if [[ ! -f "$dest" && ${#files[@]} -gt 0 ]]; then | |
| mv "${files[0]}" "$dest" | |
| fi | |
| - name: Fetch Tag Info | |
| run: git fetch --tags --force | |
| - name: Get Tag Info | |
| uses: ericcornelissen/git-tag-annotation-action@v2 | |
| id: tag-data | |
| - name: Show Tag Annotation | |
| run: echo ${{ steps.tag-data.outputs.git-tag-annotation }} | |
| - name: Create JSON Description from Tag Annotation if Available | |
| if: ${{ steps.tag-data.outputs.git-tag-annotation != '' }} | |
| run: echo "${{ steps.tag-data.outputs.git-tag-annotation }}" > firmware/annotation.txt | |
| - name: Prepare platform release JSON | |
| run: .github/workflows/preprelease.sh ${{ matrix.target-platform }} ${{ env.TAG_NAME }} ${{ github.repository_owner }} | |
| shell: bash | |
| - name: Upload Release ZIP | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fujinet-${{ matrix.target-platform }}-${{ env.TAG_NAME }}.zip | |
| path: firmware/fujinet-${{ matrix.target-platform }}-${{ env.TAG_NAME }}.zip | |
| - name: Upload Releases JSON | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: releases-${{ matrix.target-platform }}.json | |
| path: firmware/releases-${{ matrix.target-platform }}.json | |
| - name: Push Files to Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| files: | | |
| firmware/fujinet-${{ matrix.target-platform }}-${{ env.TAG_NAME }}.zip | |
| firmware/releases-${{ matrix.target-platform }}.json | |
| - name: Get Git Short SHA | |
| id: shortsha | |
| run: | | |
| echo "SHORTSHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Notify FujiNet server | |
| run: wget "https://fujinet.online/newfirmware.php?version=${{ env.TAG_NAME }}&platform=${{ matrix.target-platform }}&githash=${{ steps.shortsha.outputs.SHORTSHA }}" | |
| push-changelog: | |
| name: "Push Change Log" | |
| needs: tagged-release | |
| runs-on: ubuntu-latest | |
| env: | |
| TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }} | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Save commits to change log | |
| run: git log $(git describe --tags --abbrev=0 @^ 2> /dev/null)..@ --oneline > CHANGE.log | |
| - name: Upload Change Log | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CHANGE.log | |
| path: CHANGE.log | |
| - name: Push Change log to Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| files: CHANGE.log |