Skip to content

Commit

Permalink
nightly: change filenames to fujinet-platform-version.shortsha_commit…
Browse files Browse the repository at this point in the history
…date.zip
  • Loading branch information
mozzwald committed May 31, 2024
1 parent abadbbe commit 84318b4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,34 @@ jobs:
with:
length: 6

- name: Get Version
- name: Get Old Version
id: version
run: echo "VERSION=$(grep '#define FN_VERSION_FULL' /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h | sed 's/^.*"\(.*\)".*$/\1/')" >> $GITHUB_OUTPUT

- name: Get Commit Date
id: commit-date
run: echo "COMMIT_DATE=$(git --no-pager log -1 --pretty='format:%cd' --date='format:%Y-%m-%d %H:%M:%S')">> $GITHUB_OUTPUT

- name: Set Nightly Version in Firmware
id: nightly-version
run: sed -i "s/\"${{ steps.version.outputs.VERSION }}\"/\"${{ steps.version.outputs.VERSION }}-$(date +%Y%m%d)-${{ steps.short-sha.outputs.sha }}\"/" /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h
run: sed -i "s/\"${{ steps.version.outputs.VERSION }}\"/\"${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}\"/" /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h

- name: Set Version Date in Firmware
id: nightly-date
run: sed -i 's/#define FN_VERSION_DATE "[^"]*"/#define FN_VERSION_DATE "${{ steps.commit-date.outputs.COMMIT_DATE }}"/' /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h

- 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: Fix firmware name
run: mv firmware/fujinet*.zip firmware/fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}-${{ github.ref_name }}.zip
run: mv firmware/fujinet*.zip firmware/fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}.zip

- name: Deploy ${{ matrix.target-platform }} Firmware
uses: WebFreak001/[email protected]
with:
upload_url: https://uploads.github.com/repos/FujiNetWIFI/fujinet-firmware/releases/156608864/assets{?name,label}
release_id: 156608864
asset_path: ./firmware/fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}-${{ github.ref_name }}.zip
asset_name: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}-$$.zip
asset_path: ./firmware/fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}.zip
asset_name: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}_${{ steps.commit-date.outputs.COMMIT_DATE }}.zip
asset_content_type: application/zip
max_releases: 1

0 comments on commit 84318b4

Please sign in to comment.