2022-04-01 23:38:19 +00:00
|
|
|
name: Nightly Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *"
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2022-04-03 03:36:37 +00:00
|
|
|
check_date:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Check latest commit
|
|
|
|
outputs:
|
|
|
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: print latest_commit
|
|
|
|
run: echo ${{ github.sha }}
|
|
|
|
|
|
|
|
- name: check latest commit is less than a day
|
|
|
|
id: should_run
|
|
|
|
continue-on-error: true
|
2024-01-21 18:24:38 +00:00
|
|
|
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT
|
2022-04-01 23:38:19 +00:00
|
|
|
build:
|
2022-04-03 03:36:37 +00:00
|
|
|
needs: check_date
|
|
|
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
2022-04-01 23:38:19 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Get current date
|
|
|
|
id: date
|
2024-01-21 18:24:38 +00:00
|
|
|
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
2022-04-03 03:36:37 +00:00
|
|
|
- name: Get version date
|
|
|
|
id: version_date
|
2024-01-21 18:24:38 +00:00
|
|
|
run: echo "date=n_$(date +'%y%m%d')" >> $GITHUB_OUTPUT
|
2022-04-01 23:38:19 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
with:
|
2022-04-03 19:15:24 +00:00
|
|
|
fetch-depth: 0
|
2024-01-05 20:59:15 +00:00
|
|
|
#ref: next
|
|
|
|
# The branch, tag or SHA to checkout. When checking out the repository that
|
|
|
|
# triggered a workflow, this defaults to the reference or SHA for that event.
|
|
|
|
# Otherwise, uses the default branch.
|
|
|
|
# https://github.com/actions/checkout
|
|
|
|
# So scheduled runs will use the default branch (next) but its now possible to trigger a workflow from another branch
|
2022-04-01 23:38:19 +00:00
|
|
|
submodules: true
|
|
|
|
- name: Git Sumbodule Update
|
|
|
|
run: |
|
|
|
|
git submodule update --init --recursive
|
|
|
|
- name: Build the Docker image
|
|
|
|
run: docker build -t portapack-dev -f dockerfile-nogit . --tag my-image-name:$(date +%s)
|
|
|
|
- name: Make build folder
|
|
|
|
run: mkdir ${{ github.workspace }}/build
|
|
|
|
- name: Run the Docker image
|
2022-04-03 03:36:37 +00:00
|
|
|
run: docker run -e VERSION_STRING=${{ steps.version_date.outputs.date }} -i -v ${{ github.workspace }}:/havoc portapack-dev
|
2023-07-10 07:43:39 +00:00
|
|
|
- name: Create Small SD Card ZIP - No World Map
|
|
|
|
run: |
|
2024-01-07 06:51:27 +00:00
|
|
|
mkdir -p sdcard/FIRMWARE && cp build/firmware/portapack-h1_h2-mayhem.bin sdcard/FIRMWARE/portapack-mayhem_${{ steps.version_date.outputs.date }}.bin && mkdir -p sdcard/APPS && cp build/firmware/application/*.ppma sdcard/APPS && cd sdcard && zip -r ../sdcard-no-map.zip . && cd ..
|
2023-05-21 06:42:38 +00:00
|
|
|
- name: Download world map
|
|
|
|
run: |
|
2024-01-10 08:13:43 +00:00
|
|
|
wget https://github.com/portapack-mayhem/mayhem-firmware/releases/download/world_map/world_map.zip
|
2023-05-21 06:42:38 +00:00
|
|
|
- name: Unzip world map
|
|
|
|
run: |
|
|
|
|
unzip world_map.zip -d sdcard/ADSB
|
2022-04-01 23:38:19 +00:00
|
|
|
- name: Create Firmware ZIP
|
|
|
|
run: |
|
2022-04-06 09:34:35 +00:00
|
|
|
zip -j firmware.zip build/firmware/portapack-h1_h2-mayhem.bin && cd flashing && zip -r ../firmware.zip *
|
2022-04-01 23:38:19 +00:00
|
|
|
- name: Create SD Card ZIP
|
|
|
|
run: |
|
2024-01-07 06:51:27 +00:00
|
|
|
mkdir -p sdcard/FIRMWARE && cp build/firmware/portapack-h1_h2-mayhem.bin sdcard/FIRMWARE/portapack-mayhem_${{ steps.version_date.outputs.date }}.bin && mkdir -p sdcard/APPS && cp build/firmware/application/*.ppma sdcard/APPS && cd sdcard && zip -r ../sdcard.zip . && cd ..
|
2022-04-03 19:15:24 +00:00
|
|
|
- name: Create changelog
|
2023-07-11 07:51:22 +00:00
|
|
|
env:
|
2024-01-03 21:32:34 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-03 19:15:24 +00:00
|
|
|
run: |
|
2022-04-03 21:00:41 +00:00
|
|
|
CHANGELOG=$(python3 .github/workflows/changelog.py)
|
2022-04-03 19:15:24 +00:00
|
|
|
CHANGELOG="${CHANGELOG//'%'/'%25'}"
|
|
|
|
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
|
|
|
|
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
|
2024-01-21 18:24:38 +00:00
|
|
|
echo "content=$CHANGELOG" >> $GITHUB_OUTPUT
|
2022-04-03 19:15:24 +00:00
|
|
|
id: changelog
|
2022-04-01 23:38:19 +00:00
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: nightly-tag-${{ steps.date.outputs.date }}
|
2022-04-03 19:15:24 +00:00
|
|
|
release_name: Nightly Release - ${{ steps.date.outputs.date }}
|
2022-04-01 23:38:19 +00:00
|
|
|
body: |
|
|
|
|
**Nightly release - ${{ steps.date.outputs.date }}**
|
|
|
|
This build is the latest and greatest, although may not be the most stable as this is a nightly release.
|
2022-04-03 19:15:24 +00:00
|
|
|
## Release notes
|
|
|
|
### Revision (${{ steps.version_date.outputs.date }}):
|
|
|
|
${{ steps.changelog.outputs.content }}
|
2022-04-01 23:38:19 +00:00
|
|
|
draft: false
|
|
|
|
prerelease: true
|
2024-01-03 21:32:34 +00:00
|
|
|
- name: Upload Firmware TAR Asset
|
|
|
|
id: upload-firmware-tar-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2024-01-18 20:08:02 +00:00
|
|
|
asset_path: build/firmware/portapack-mayhem_OCI.ppfw.tar
|
2024-01-04 07:52:42 +00:00
|
|
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_OCI.ppfw.tar
|
2024-01-03 21:32:34 +00:00
|
|
|
asset_content_type: application/x-tar
|
2022-04-01 23:38:19 +00:00
|
|
|
- name: Upload Firmware Asset
|
|
|
|
id: upload-firmware-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-04-01 23:46:51 +00:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2022-04-01 23:38:19 +00:00
|
|
|
asset_path: ./firmware.zip
|
2022-04-03 03:36:37 +00:00
|
|
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_FIRMWARE.zip
|
2022-04-01 23:38:19 +00:00
|
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload SD Card Assets
|
|
|
|
id: upload-sd-card-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-04-01 23:46:51 +00:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2022-04-01 23:38:19 +00:00
|
|
|
asset_path: ./sdcard.zip
|
2022-04-03 19:15:24 +00:00
|
|
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_COPY_TO_SDCARD.zip
|
2022-04-06 09:34:35 +00:00
|
|
|
asset_content_type: application/zip
|
2023-07-10 07:43:39 +00:00
|
|
|
- name: Upload SD Card Assets - No Map
|
|
|
|
id: upload-sd-card-asset-no-map
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ./sdcard-no-map.zip
|
|
|
|
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_COPY_TO_SDCARD-no-world-map.zip
|
|
|
|
asset_content_type: application/zip
|