Modify workflow to only push tags

This commit is contained in:
Djuri Baars 2023-11-03 12:41:54 +01:00
parent 62358a7c6e
commit 7cc524f75f

View File

@ -1,6 +1,9 @@
name: BTClock CI name: BTClock CI
on: [push] on:
push:
tags:
- '*'
jobs: jobs:
build: build:
@ -24,6 +27,9 @@ jobs:
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: '3.9'
- name: Get current date
id: dateAndTime
run: echo "::set-output name=dateAndTime::$(date +'%Y-%m-%d-%H:%M')"
- name: Install PlatformIO Core - name: Install PlatformIO Core
run: pip install --upgrade platformio run: pip install --upgrade platformio
@ -51,6 +57,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name:
path: | path: |
.pio/build/esp32wemos-s3-mini_BW/*.bin .pio/build/esp32wemos-s3-mini_BW/*.bin
output/full-firmware.bin output/full-firmware.bin
@ -59,8 +66,7 @@ jobs:
- name: Create release - name: Create release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: main name: release-${{ steps.date.outputs.dateAndTime }}
commit: main
artifacts: "output/full-firmware.bin,output/full-firmware.sha256,.pio/build/esp32wemos-s3-mini_BW/*.bin" artifacts: "output/full-firmware.bin,output/full-firmware.sha256,.pio/build/esp32wemos-s3-mini_BW/*.bin"
allowUpdates: true allowUpdates: true
removeArtifacts: true removeArtifacts: true