Skip to content

Commit 49362da

Browse files
committed
ci: add release action
Signed-off-by: Urban Vidovič <[email protected]>
1 parent f911484 commit 49362da

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
build:
12+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '14.15'
23+
24+
- name: Run grunt
25+
run: npx grunt
26+
27+
- name: Zip files
28+
run: zip -r release.zip .
29+
30+
- name: Create GitHub Release
31+
id: create_release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: ${{ github.ref }}
37+
release_name: Release ${{ github.ref }}
38+
draft: false
39+
prerelease: false
40+
41+
- name: Upload Release
42+
uses: ncipollo/[email protected]
43+
with:
44+
artifacts: "release.zip"
45+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)