upgrade to ndoe 20 #2
Workflow file for this run
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
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: '20' | |
- 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 }} |