Update release.yml #22
Workflow file for this run
This file contains hidden or 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: release | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: update version in repo | |
| env: | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| tmp=$(mktemp) | |
| jq --arg version $tag '.versions |= [$version] + .' versions.json > "$tmp" && mv "$tmp" versions.json | |
| git config --global user.name 'Alan Bits' | |
| git config --global user.email 'alan@lnbits.com' | |
| git commit -am "[CHORE] update version to $tag" | |
| git push | |
| git push --delete origin $tag | |
| git tag -fa $tag -m "update via workflow" | |
| git push --tags | |
| - name: Install Arduino CLI | |
| uses: arduino/setup-arduino-cli@v1 | |
| - name: Force 80MHz flash for ttgo-lora32 | |
| run: | | |
| # Replace plain FQBN with FlashFreq=80 in build.sh (only change) | |
| sed -i 's/esp32:esp32:ttgo-lora32/esp32:esp32:ttgo-lora32:FlashFreq=80/g' build.sh | |
| echo "Patched build.sh to use FlashFreq=80" | |
| - name: build sketch with arduino cli | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| sh build.sh | |
| - name: Create github release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| gh release create "$tag" --generate-notes ./build/fossa.ino.bootloader.bin \ | |
| ./build/fossa.ino.bin ./build/fossa.ino.partitions.bin | |
| deploy: | |
| needs: [ release ] | |
| uses: ./.github/workflows/static.yml |