Repository navigation
Merge pull request #11 from HITEYY/codex/review-and-improve-entire-co… #52
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: Build Firmware and App Package | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| tags: | |
| - "v*" | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: build-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: | |
| - t-embed-cc1101 | |
| - t-deck | |
| - cardputer | |
| - cyd-2432s028 | |
| - esp32s3-generic | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install PlatformIO | |
| run: pip install --upgrade platformio | |
| - name: Build firmware | |
| run: pio run -e ${{ matrix.env }} | |
| - name: Package build artifacts | |
| env: | |
| PIO_ENV: ${{ matrix.env }} | |
| VERSION_TAG: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || github.sha }} | |
| REPO_SLUG: ${{ github.repository }} | |
| INCLUDE_LATEST_ALIAS: ${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }} | |
| INCLUDE_APP_BUNDLE: "true" | |
| run: bash scripts/package_release_assets.sh | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-${{ matrix.env }} | |
| path: dist/* | |
| if-no-files-found: error | |
| retention-days: 14 | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: all-artifacts | |
| - name: Merge artifacts into dist | |
| run: | | |
| mkdir -p dist | |
| for d in all-artifacts/build-*/; do | |
| cp "$d"* dist/ 2>/dev/null || true | |
| done | |
| ls -la dist/ | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| target_commitish: ${{ github.sha }} | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| dist/* | |
| fail_on_unmatched_files: false |