|
5 | 5 | release-version: |
6 | 6 | type: string |
7 | 7 | description: Firmware Version |
8 | | - default: 'v0.0.0' |
| 8 | + default: 'vX.X.X' |
9 | 9 | required: true |
| 10 | + release-type: |
| 11 | + type: choice |
| 12 | + description: Production or Development? |
| 13 | + options: |
| 14 | + - production |
| 15 | + - development |
| 16 | + default: 'development' |
10 | 17 | pull_request: |
11 | 18 |
|
12 | 19 | jobs: |
@@ -43,15 +50,58 @@ jobs: |
43 | 50 | run: pio run -e esp-wrover-kit |
44 | 51 | - name: Rename firmware |
45 | 52 | run: cp .pio/build/esp-wrover-kit/firmware.bin esp32.bin |
46 | | - - name: Release |
47 | | - uses: ncipollo/release-action@v1 |
| 53 | + - name: Cache Build |
| 54 | + if: github.event_name == 'workflow_dispatch' |
| 55 | + uses: actions/cache@v3 |
| 56 | + with: |
| 57 | + path: 'esp32.bin' |
| 58 | + key: ${{ runner.os }}-${{ github.run_id }} |
| 59 | + |
| 60 | + archive: |
| 61 | + needs: build |
| 62 | + runs-on: ubuntu-latest |
| 63 | + permissions: |
| 64 | + contents: write |
| 65 | + steps: |
| 66 | + - name: Get Cached Build |
48 | 67 | if: github.event_name == 'workflow_dispatch' |
| 68 | + uses: actions/cache@v3 |
49 | 69 | with: |
50 | | - artifacts: "*.bin" |
| 70 | + path: 'esp32.bin' |
| 71 | + key: ${{ runner.os }}-${{ github.run_id }} |
| 72 | + - name: Archive Build |
| 73 | + uses: actions/upload-artifact@v3 |
| 74 | + with: |
| 75 | + path: 'esp32.bin' |
| 76 | + |
| 77 | + release: |
| 78 | + needs: build |
| 79 | + if: github.event_name == 'workflow_dispatch' |
| 80 | + runs-on: ubuntu-latest |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + steps: |
| 84 | + - name: Get Cached Build |
| 85 | + if: github.event_name == 'workflow_dispatch' |
| 86 | + uses: actions/cache@v3 |
| 87 | + with: |
| 88 | + path: 'esp32.bin' |
| 89 | + key: ${{ runner.os }}-${{ github.run_id }} |
| 90 | + - name: Development Release |
| 91 | + uses: ncipollo/release-action@v1 |
| 92 | + if: inputs.release-type == 'development' |
| 93 | + with: |
| 94 | + artifacts: '*.bin' |
51 | 95 | generateReleaseNotes: true |
52 | 96 | tag: ${{ inputs.release-version }} |
53 | 97 | token: ${{ secrets.GITHUB_TOKEN }} |
54 | | - - name: Archive Build |
55 | | - uses: actions/upload-artifact@v3 |
| 98 | + prerelease: true |
| 99 | + makeLatest: false |
| 100 | + - name: Production Release |
| 101 | + uses: ncipollo/release-action@v1 |
| 102 | + if: inputs.release-type == 'production' |
56 | 103 | with: |
57 | | - path: "*.bin" |
| 104 | + artifacts: '*.bin' |
| 105 | + generateReleaseNotes: true |
| 106 | + tag: ${{ inputs.release-version }} |
| 107 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments