Skip to content

Commit

Permalink
add a release action
Browse files Browse the repository at this point in the history
  • Loading branch information
altintx committed Sep 8, 2024
1 parent 5225391 commit cd2f8a6
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
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 }}

0 comments on commit cd2f8a6

Please sign in to comment.