1
1
name : Create Release and Upload Files
2
2
3
3
on :
4
- # Triggers the workflow on a new tag push (typically used to create a release)
4
+ # Trigger the workflow when a new tag is pushed
5
5
push :
6
6
tags :
7
- - ' v*' # Match any tag that starts with 'v', e.g., 'v1.0.0'
7
+ - ' v*' # Matches any tag that starts with 'v', e.g., 'v1.0.0'
8
+
9
+ permissions :
10
+ contents : write # Grant write permission for contents to create releases
8
11
9
12
jobs :
10
13
build :
19
22
- name : Setup Node.js
20
23
uses : actions/setup-node@v3
21
24
with :
22
- node-version : ' 18' # Use Node.js version 18 (or any version your project supports )
25
+ node-version : ' 18' # Use Node.js version 18 (or any version your project requires )
23
26
24
27
# Install dependencies using Yarn
25
28
- name : Install dependencies
@@ -29,19 +32,19 @@ jobs:
29
32
- name : Build project using Vite
30
33
run : yarn build
31
34
32
- # Create a GitHub release
35
+ # Create GitHub Release using the tag
33
36
- name : Create GitHub Release
34
37
id : create_release
35
- uses : softprops/action-gh -release@v1
38
+ uses : actions/create -release@v1
36
39
with :
37
- tag_name : ${{ github.ref_name }}
38
- name : Release ${{ github.ref_name }}
40
+ tag_name : ${{ github.ref_name }} # Use the tag name that triggered the workflow
41
+ release_name : Release ${{ github.ref_name }} # Name the release after the tag
39
42
body : |
40
43
Automatic release for version ${{ github.ref_name }}.
41
44
draft : false
42
45
prerelease : false
43
46
env :
44
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Use the GitHub token to authenticate
45
48
46
49
# Upload the contents of the dist/ folder to the release
47
50
- name : Upload files to Release
51
54
asset_path : ./dist/gms2.api.js # Path to the main file you want to upload
52
55
asset_name : gms2.api.js # Name that will appear in the release
53
56
asset_content_type : application/javascript # File type (adjust if necessary)
57
+ env :
58
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54
59
55
60
0 commit comments