2021-04-16 05:37:00 +00:00
name : Make Release
on :
# Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on.
2022-02-10 22:23:34 +00:00
workflow_dispatch :
2021-04-16 07:03:38 +00:00
# inputs:
2021-12-06 00:31:36 +00:00
# Only want to run if version.properties is bumped in master
2021-04-16 07:03:38 +00:00
push :
branches :
2021-12-06 00:31:36 +00:00
- master
paths :
2022-03-09 13:04:49 +00:00
- "version.properties"
2021-04-16 05:37:00 +00:00
jobs :
2021-04-16 07:31:53 +00:00
release-build :
2021-04-16 05:37:00 +00:00
runs-on : ubuntu-latest
steps :
2022-03-09 13:04:49 +00:00
- name : Checkout code
uses : actions/checkout@v3
with :
submodules : "recursive"
2021-04-16 05:37:00 +00:00
2022-03-09 13:04:49 +00:00
- name : Setup Python
uses : actions/setup-python@v2
with :
python-version : 3. x
2021-04-16 05:37:00 +00:00
2022-03-09 13:04:49 +00:00
# Will be available in steps.version.outputs.version
- name : Get release version string
run : echo "::set-output name=version::$(./bin/buildinfo.py long)"
id : version
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
2021-04-16 05:46:14 +00:00
2022-03-09 13:04:49 +00:00
- name : Upgrade python tools
# We actually want to run this every time
# if: steps.cache-pip.outputs.cache-hit != 'true'
run : |
python -m pip install --upgrade pip
pip install -U platformio meshtastic adafruit-nrfutil littlefs-python
2021-04-16 05:46:14 +00:00
2022-03-09 13:04:49 +00:00
- name : Upgrade platformio
run : |
pio upgrade
2021-04-16 05:37:00 +00:00
2022-03-09 13:04:49 +00:00
- name : Pull web ui
uses : dsaltares/fetch-gh-release-asset@master
with :
repo : "meshtastic/meshtastic-web"
file : "build.tar"
target : "build.tar"
token : ${{ secrets.GITHUB_TOKEN }}
2021-10-09 06:15:12 +00:00
2022-03-09 13:04:49 +00:00
- name : Unpack web ui
run : |
tar -xf build.tar -C data/static
rm build.tar
2021-10-09 06:15:12 +00:00
2022-03-09 13:04:49 +00:00
- name : Build everything
run : bin/build-all.sh
2021-04-16 05:37:00 +00:00
2022-03-09 13:04:49 +00:00
- name : Create release
uses : actions/create-release@v1
id : create_release
with :
draft : true
prerelease : true
release_name : ${{ steps.version.outputs.version }} alpha
tag_name : v${{ steps.version.outputs.version }}
body : |
Autogenerated by github action, developer should edit as required before publishing...
env :
GITHUB_TOKEN : ${{ github.token }}
2021-04-16 05:37:00 +00:00
2022-03-09 13:04:49 +00:00
- name : Add bins to release
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ github.token }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : release/archive/firmware-${{ steps.version.outputs.version }}.zip
asset_name : firmware-${{ steps.version.outputs.version }}.zip
asset_content_type : application/zip
2021-05-26 02:21:26 +00:00
2022-03-09 13:04:49 +00:00
- name : Add debug elfs to release
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ github.token }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : release/archive/elfs-${{ steps.version.outputs.version }}.zip
asset_name : debug-elfs-${{ steps.version.outputs.version }}.zip
asset_content_type : application/zip