-
Notifications
You must be signed in to change notification settings - Fork 32
96 lines (81 loc) · 2.57 KB
/
release.yml
File metadata and controls
96 lines (81 loc) · 2.57 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release
on:
push:
branches: [main]
permissions:
contents: write
issues: write
pull-requests: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
new_release: ${{ steps.check.outputs.new_release }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Get latest tag before release
id: before
run: echo "tag=$(git tag -l 'v*' --sort=-v:refname | head -1)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: |
npm install \
semantic-release \
conventional-changelog-conventionalcommits \
@semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
@semantic-release/changelog \
@semantic-release/exec \
@semantic-release/git \
@semantic-release/github
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: Check if new release was created
id: check
run: |
git fetch --tags
LATEST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1)
BEFORE_TAG="${{ steps.before.outputs.tag }}"
if [ "$LATEST_TAG" != "$BEFORE_TAG" ] && [ -n "$LATEST_TAG" ]; then
VERSION="${LATEST_TAG#v}"
echo "new_release=true" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "New release: $VERSION"
else
echo "new_release=false" >> $GITHUB_OUTPUT
echo "No new release"
fi
build:
name: Build & Upload
needs: release
if: needs.release.outputs.new_release == 'true'
runs-on: ubuntu-latest
container:
image: espressif/idf:v5.5.1
steps:
- uses: actions/checkout@v4
with:
ref: main
submodules: recursive
- name: Build
run: bash tools/build.sh
shell: bash
- name: Rename binary
run: cp firmware_p4/build/TentacleOS_P4.bin "TentacleOS_v${{ needs.release.outputs.version }}.bin"
- name: Upload binary to Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ needs.release.outputs.version }}"
files: "TentacleOS_v${{ needs.release.outputs.version }}.bin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}