Prepare Release #3
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
name: Prepare Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.platformio/.cache | |
key: ${{ runner.os }}-pio | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install PlatformIO Core | |
run: pip install --upgrade platformio | |
- name: Build PlatformIO Project | |
run: pio run | |
- name: Get Versions | |
id: versions | |
run: | | |
VERSION_NUMBER=$(grep -oP '(?<=#define VERSION_NUMBER ").*(?=")' ./src/Main.h) | |
BASE_VERSION=$(grep -oP '(?<=#define BASE_VERSION ").*(?=")' ./src/base/Version.h) | |
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV | |
echo "BASE_VERSION=${BASE_VERSION}" >> $GITHUB_ENV | |
echo "VERSION=v${BASE_VERSION}-${VERSION_NUMBER}" >> $GITHUB_ENV | |
- name: Rename Firmware | |
run: mv .pio/build/d1_mini/WirelessPalaControl.bin .pio/build/d1_mini/WirelessPalaControl.${{ env.VERSION }}.bin | |
- name: Create Draft Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
tag_name: "${{ env.VERSION }}" | |
body: "Base Version: ${{ env.BASE_VERSION }}\nWPalaControl Version: ${{ env.VERSION_NUMBER }}" | |
generate_release_notes: true | |
files: .pio/build/d1_mini/WirelessPalaControl.${{ env.VERSION }}.bin |