-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a4d27d
commit 5b55693
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build and Zip | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Node.js | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
# Step 4: Build the project | ||
- name: Run build script | ||
run: npm run build | ||
|
||
# Step 5: Create a single ZIP file of the build directory | ||
- name: Zip the build | ||
run: | | ||
zip -r build.zip ./build # Directly create build.zip in the root directory | ||
# Step 6: Upload the ZIP file as an artifact | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-zip | ||
path: target/release/build.zip | ||
|
||
# Step 7: Copy file to release | ||
- name: Copy file to release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
target/release/build.zip |