-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (45 loc) · 1.44 KB
/
release.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
41
42
43
44
45
46
47
48
49
50
51
52
53
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: update version in repo
env:
tag: ${{ github.ref_name }}
run: |
tmp=$(mktemp)
jq --arg version $tag '.versions |= [$version] + .' versions.json > "$tmp" && mv "$tmp" versions.json
git config --global user.name 'Alan Bits'
git config --global user.email '[email protected]'
git commit -am "[CHORE] update version to $tag"
git push
git push --delete origin $tag
git tag -fa $tag -m "update via workflow"
git push --tags
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: build sketch with arduino cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
sh build.sh
- name: Create github release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" --generate-notes ./build/nostrZapLamp.ino.bootloader.bin \
./build/nostrZapLamp.ino.bin ./build/nostrZapLamp.ino.partitions.bin