Merge branch 'main' of github.com:spuder/OpenSpool #24
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: ESPHome Build and Commit Manifest | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- 'firmware/**' | ||
paths-ignore: | ||
- 'firmware/manifest.json' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
- name: Create empty secrets file | ||
run: | | ||
touch firmware/secrets.yaml | ||
touch firmware/conf.d/secrets.yaml | ||
- name: Build ESPHome firmware | ||
uses: esphome/[email protected] | ||
with: | ||
yaml-file: firmware/config.yaml | ||
release-summary: "Test" #TODO: change this to the commit message | ||
complete-manifest: true | ||
release-url: "https://raw.githubusercontent.com/spuder/OpenSpool/main/firmware/manifest.json" | ||
- name: List output files | ||
run: | | ||
ls -l openspool-esp32s2 | ||
- name: Copy manifest to firmware folder | ||
run: | | ||
cp openspool-esp32s2/manifest.json firmware/manifest.json | ||
- name: Commit manifest file | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
committer_name: GitHub Actions | ||
committer_email: [email protected] | ||
message: Update manifest.json | ||
add: "firmware/manifest.json" | ||
push: true | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: openspool-esp32s2-${{ github.sha }} | ||
path: | | ||
openspool-esp32s2/*.bin | ||
openspool-esp32s2/manifest.json | ||
retention-days: 90 | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete old artifacts | ||
uses: c-hive/gha-remove-artifacts@v1 | ||
with: | ||
age: '90 days' | ||
skip-recent: 5 |