-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.06 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: build
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v2
with:
path: "requirements.txt"
update-pip: "true"
update-setuptools: "false"
update-wheel: "false"
- name: Compile
run: pio run -e release
- name: Set env
if: ${{ github.event_name == 'release' }}
run: |
echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
mv .pio/build/release/firmware.bin ${GITHUB_REPOSITORY##*/}-${GITHUB_REF#refs/*/}.bin
- name: Release
if: ${{ github.event_name == 'release' }}
uses: softprops/action-gh-release@v0.1.5
env:
GITHUB_TOKEN: ${{ github.token }}
with:
files: ${{ env.REPOSITORY_NAME }}-${{ env.GITHUB_TAG }}.bin