-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nightly: change filenames to fujinet-platform-version.shortsha_commit…
…date.zip
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |