-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
62 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,62 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Set up Node.js environment and install dependencies | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
# Run the build script (assuming "build" is the npm script) | ||
- name: Build the project | ||
run: npm run build | ||
|
||
# Prepare the zip file for the extension | ||
- name: Create zip of root and dist | ||
run: zip -r chrome-extension.zip . -x "node_modules/*" ".git/*" ".github" | ||
|
||
# Upload as an artifact (optional step for debugging) | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: chrome-extension | ||
path: chrome-extension.zip | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
# Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Download the artifact created in the build step | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: chrome-extension | ||
|
||
# Create a GitHub release | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: chrome-extension.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |