Skip to content

Merge pull request #4 from redmushie/feature/release-body #3

Merge pull request #4 from redmushie/feature/release-body

Merge pull request #4 from redmushie/feature/release-body #3

Workflow file for this run

on:
push:
tags:
- 'v**'
name: ci-tag
jobs:
# Copied verbatim from https://docs.platformio.org/en/stable/integration/ci/github-actions.html
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/cache
key: ${{ runner.os }}-arch
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run
# This step reads a file from repo and use it for body of the release
# This works on any self-hosted runner OS
- name: Read RELEASE.md
id: read_release
shell: bash
run: |
r=$(cat RELEASE.md) # <--- Read release.md (Provide correct path as per your repo)
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT # <--- Set environment variable
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .pio/build/ShockLink/firmware.bin
asset_name: ShockLink.bin
tag: ${{ github.ref }}
body: |
${{ steps.read_release.outputs.RELEASE_BODY }} # <--- Use environment variables that was created earlier