From cd2f8a66158e8114f642a7b45e4b0d31e3c69ff5 Mon Sep 17 00:00:00 2001 From: Brian Bosh Date: Sat, 7 Sep 2024 21:49:48 -0600 Subject: [PATCH] add a release action --- .github/workflows/release.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e7826e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file