Skip to content

Commit 739eada

Browse files
authored
Merge pull request #4 from thoughtco/feature/add-release-workflow
Add release workflow and build assets
2 parents e0641ca + 67cf942 commit 739eada

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/release.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Use Node.js 23.3.0
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 23.3.0
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Build release assets
24+
run: npm run build
25+
26+
- name: Create zip
27+
run: tar -czvf dist.tar.gz dist
28+
29+
- name: Get Changelog
30+
id: changelog
31+
uses: statamic/changelog-action@v1
32+
with:
33+
version: ${{ github.ref }}
34+
35+
- name: Create release
36+
id: create_release
37+
uses: actions/create-release@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
tag_name: ${{ steps.changelog.outputs.version }}
42+
release_name: ${{ steps.changelog.outputs.version }}
43+
body: ${{ steps.changelog.outputs.text }}
44+
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
45+
46+
- name: Upload dist zip to release
47+
uses: actions/upload-release-asset@v1.0.1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: ./dist.tar.gz
53+
asset_name: dist.tar.gz
54+
asset_content_type: application/tar+gz

0 commit comments

Comments
 (0)