|
| 1 | +on: |
| 2 | + push: |
| 3 | + # Sequence of patterns matched against refs/tags |
| 4 | + tags: |
| 5 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 6 | + |
| 7 | +name: Upload Release Asset |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Upload Release Asset |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Set up Python |
| 21 | + uses: actions/setup-python@v1 |
| 22 | + with: |
| 23 | + python-version: 3.8 |
| 24 | + |
| 25 | + - name: Build project # This would actually build your project, using zip for an example artifact |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + pip install platformio |
| 29 | +
|
| 30 | + platformio run -e esp01s_prod -e esp12e_prod |
| 31 | + platformio run -e esp01s_prod -e esp12e_prod -t buildfs |
| 32 | +
|
| 33 | + cd .pio/build |
| 34 | + zip --junk-paths ../../wifinfo-esp01_1m.zip esp01s_prod/*.bin |
| 35 | + zip --junk-paths ../../wifinfo-esp12e.zip esp12e_prod/*.bin |
| 36 | +
|
| 37 | + - name: Create Release |
| 38 | + id: create_release |
| 39 | + uses: actions/create-release@v1 |
| 40 | + env: |
| 41 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + with: |
| 43 | + tag_name: ${{ github.ref }} |
| 44 | + release_name: Release ${{ github.ref }} |
| 45 | + draft: false |
| 46 | + prerelease: false |
| 47 | + |
| 48 | + - name: Upload Release Asset 1 |
| 49 | + id: upload-release-asset-1 |
| 50 | + uses: actions/upload-release-asset@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 55 | + asset_path: ./wifinfo-esp01_1m.zip |
| 56 | + asset_name: wifinfo-esp01_1m.zip |
| 57 | + asset_content_type: application/zip |
| 58 | + |
| 59 | + - name: Upload Release Asset 2 |
| 60 | + id: upload-release-asset-2 |
| 61 | + uses: actions/upload-release-asset@v1 |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 66 | + asset_path: ./wifinfo-esp12e.zip |
| 67 | + asset_name: wifinfo-esp12e.zip |
| 68 | + asset_content_type: application/zip |
0 commit comments