diff --git a/.github/workflows/deploy_releases.yml b/.github/workflows/deploy_releases.yml new file mode 100644 index 0000000..a643504 --- /dev/null +++ b/.github/workflows/deploy_releases.yml @@ -0,0 +1,65 @@ +name: Deploy Releases + +# Trigger the workflow on pushes to tags matching 'v*.*.*' +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Set up ESP-IDF and Build + uses: espressif/esp-idf-ci-action@v1.1.0 + with: + esp_idf_version: v5.2.1 + target: esp32s3 + path: 'ESP32/Digifiz/' + + - name: Collect Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: firmware + path: | + ESP32/Digifiz/build/*.bin + ESP32/Digifiz/build/*.elf + + - 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 ${{ github.ref }} + body: | + Automated release for `${{ github.ref }}`. + draft: false + prerelease: false + + - name: Upload Firmware to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ESP32/Digifiz/build/your_firmware.bin + asset_name: your_firmware.bin + asset_content_type: application/octet-stream + + - name: Upload ELF to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ESP32/Digifiz/build/your_firmware.elf + asset_name: your_firmware.elf + asset_content_type: application/octet-stream