Skip to content

Update main.yml - change bin name #27

Update main.yml - change bin name

Update main.yml - change bin name #27

Workflow file for this run

name: PlatformIO CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: write temp file with build number and set to env variable
run: |
mv .pio/build/esp12e/firmware.bin .pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
# touch ${{ github.workspace }}/include/buildnumber.txt
# printf -v BUILDNUMBER "%04ddev" ${{github.run_number}}
# echo $BUILDNUMBER >> ${{ github.workspace }}/hooks/buildnumber.txt
# echo "cat ../buildnumber.txt"
# cat ${{ github.workspace }}/hooks/buildnumber.txt
# echo "CURRENT_BUILDNUMBER=$BUILDNUMBER" >> $GITHUB_ENV
- name: Build PlatformIO Project
run: pio run
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: .pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "snapshot"
prerelease: true
title: "Latest snapshot"
files: |
.pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
include/version.json
# - name: Update nightly release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: .pio/build/esp12e/firmware.bin
# asset_name: dtuGateway_snapshot.bin
# tag: devRelease
# overwrite: true
# - name: Update nightly release 2
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: include/version.json
# asset_name: snapshot.json
# tag: devRelease
# overwrite: true
# body: "dev release based on direct pushes"
# - name: Create Dev Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: devRelease
# release_name: dev drop
# body: |
# dev release based on direct pushes
# draft: true
# prerelease: false
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# 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
# asset_path: .pio/build/esp12e/firmware.bin
# asset_name: dtuGatewayFirmware_${{github.run_number}}.bin
# asset_content_type: application/x-binary