-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.63 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
54
55
56
57
58
name: Create Release
on:
workflow_dispatch: # Trigger manually
jobs:
release:
name: Create and Upload Release
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Code
uses: actions/checkout@v4
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*' # Use the latest LTS version
# Step 3: Install dependencies
- name: Install Dependencies
run: npm install
# Step 4: Build the package
- name: Build Package
run: npm run build
# Step 5: Get version and name from package.json
- name: Read package.json
id: package_info
run: |
echo "name=$(jq -r '.name' package.json)" >> $GITHUB_ENV
echo "version=$(jq -r '.version' package.json)" >> $GITHUB_ENV
# Step 6: Create the GitHub Release
- name: Create GitHub Release
id: create_release
uses: comnoco/create-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }}
release_name: ${{ env.name }} v${{ env.version }}
body: |
## Release Notes
- Version: ${{ env.version }}
- Library: ${{ env.name }}
draft: false
prerelease: false
# Step 7: Upload artifacts to the release
- name: Upload dist folder to Release
uses: AButler/[email protected]
with:
files: "./dist/*" # Matches all files in the dist folder
repo-token: ${{ secrets.GITHUB_TOKEN }}