fix: compile-and-relases fix #2
Workflow file for this run
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: Compile Sketch | |
on: | |
push: | |
tags: | |
- 'v*' # This will trigger the workflow for any tag starting with 'v' | |
jobs: | |
compile-sketch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Compile sketch | |
uses: arduino/compile-sketches@v1 | |
with: | |
verbose: true | |
platforms: | | |
- name: esp32:esp32 | |
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | |
version: 3.0.0 | |
fqbn: esp32:esp32:d1_mini32 | |
sketch-paths: | | |
- ./ | |
libraries: | | |
- name: RotaryEncoder | |
- name: ezButton | |
- name: Move compiled binary | |
run: | | |
mkdir -p ./compiled_bin | |
mv $(find /tmp/arduino/sketches -name "*.bin") ./compiled_bin/ | |
- name: Upload compiled binary as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: compiled-sketch | |
path: ./compiled_bin/om0et_quansheng_control.ino.merged.bin | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ steps.get_version.outputs.VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./compiled_bin/om0et_quansheng_control.ino.merged.bin | |
asset_name: om0et_quansheng_control.ino.merged.bin | |
asset_content_type: application/octet-stream |