Skip to content

Commit c6cb746

Browse files
committed
update: workflow file
1 parent c634083 commit c6cb746

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Create Release and Upload Files
22

33
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
55
push:
66
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
811

912
jobs:
1013
build:
@@ -19,7 +22,7 @@ jobs:
1922
- name: Setup Node.js
2023
uses: actions/setup-node@v3
2124
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)
2326

2427
# Install dependencies using Yarn
2528
- name: Install dependencies
@@ -29,19 +32,19 @@ jobs:
2932
- name: Build project using Vite
3033
run: yarn build
3134

32-
# Create a GitHub release
35+
# Create GitHub Release using the tag
3336
- name: Create GitHub Release
3437
id: create_release
35-
uses: softprops/action-gh-release@v1
38+
uses: actions/create-release@v1
3639
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
3942
body: |
4043
Automatic release for version ${{ github.ref_name }}.
4144
draft: false
4245
prerelease: false
4346
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the GitHub token to authenticate
4548

4649
# Upload the contents of the dist/ folder to the release
4750
- name: Upload files to Release
@@ -51,5 +54,7 @@ jobs:
5154
asset_path: ./dist/gms2.api.js # Path to the main file you want to upload
5255
asset_name: gms2.api.js # Name that will appear in the release
5356
asset_content_type: application/javascript # File type (adjust if necessary)
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5459

5560

0 commit comments

Comments
 (0)