Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehsan2754 committed Nov 12, 2022
1 parent 100c2b8 commit b9a7df4
Showing 1 changed file with 62 additions and 13 deletions.
75 changes: 62 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

env:
VERSION: 3.0
TARGET_DIR: /build/esp32.esp32.esp32s3
TARGET_DIR: ./build/esp32.esp32.esp32s3
TARGET_NAME: embedded-server
SKETCH_NAME: embedded-server.ino

Expand All @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1
Expand All @@ -40,38 +40,87 @@ jobs:
arduino-cli compile -e --fqbn esp32:esp32:esp32s3 ./
ls -la ./build/esp32.esp32.esp32s3
- name: release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.${{ github.run_number }}
release_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.${{ github.run_number }}
draft: false
prerelease: false

- name: Upload .bin
uses: actions/upload-artifact@v2
with:
name: ${{ env.TARGET_NAME }}${{ env.VERSION }}.bin
name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.bin
path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.bin

- name: Upload release asset .bin
id: upload-release-asset-bin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.bin
asset_path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.bin
asset_content_type: application/bin




- name: Upload .partitions.bin
uses: actions/upload-artifact@v2
with:
name: ${{ env.TARGET_NAME }}${{ env.VERSION }}.partitions.bin
name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.partitions.bin
path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.partitions.bin

- name: Upload release asset .partitions.bin
id: upload-release-asset-partitions-bin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.partitions.bin
asset_path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.partitions.bin
asset_content_type: application/bin


- name: Upload .elf
uses: actions/upload-artifact@v2
with:
name: ${{ env.TARGET_NAME }}${{ env.VERSION }}.elf
name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.elf
path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.elf

- name: Upload release asset ELF
id: upload-release-asset-elf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.elf
asset_path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.elf
asset_content_type: application/elf

- name: Upload .map
uses: actions/upload-artifact@v2
with:
name: ${{ env.TARGET_NAME }}${{ env.VERSION }}.map
name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.map
path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.map

- name: release
id: create_release
uses: actions/create-release@v1
- name: Upload release asset MAP
id: upload-release-asset-map
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TARGET_NAME }}v${{ env.VERSION }}-${{ github.run_number }}
release_name: ${{ env.TARGET_NAME }}v${{ env.VERSION }}-${{ github.run_number }}
draft: false
prerelease: false
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ env.TARGET_NAME }}V${{ env.VERSION }}.map
asset_path: ${{ env.TARGET_DIR }}/${{ env.SKETCH_NAME }}.map
asset_content_type: application/map


0 comments on commit b9a7df4

Please sign in to comment.