Skip to content

Commit 859bea6

Browse files
committed
feat: add release workflow
1 parent c6909cd commit 859bea6

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: Prepare release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '18'
18+
registry-url: 'https://registry.npmjs.org'
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Build
24+
run: npm run build
25+
26+
- name: Package files
27+
run: |
28+
mkdir release
29+
cp -r dist release/
30+
cp README.md release/
31+
cp LICENSE release/
32+
cp hacs.json release/
33+
34+
- name: Upload build artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: release
38+
path: release/
39+
40+
- name: Upload to release
41+
uses: softprops/action-gh-release@v1
42+
if: startsWith(github.ref, 'refs/tags/')
43+
with:
44+
files: |
45+
dist/ha-mi-humidifier-card.js
46+
dist/ha-mi-humidifier-card.js.map
47+
dist/humidifier-1.png
48+
hacs.json
49+
README.md
50+
LICENSE

0 commit comments

Comments
 (0)