Skip to content

Fix outdated NPM components #28

Fix outdated NPM components

Fix outdated NPM components #28

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Build Extension
on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main
env:
CRX_VER: v0.0.0-${{ github.sha }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Set version
if: ${{ github.ref_type == 'tag' }}
run: echo "CRX_VER=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Output version
run: echo "Current version ${{ env.CRX_VER }}"
- name: Pull i18n files
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull -a
- name: Rebuild the dist directory
run: npm run build
- name: Pack artifacts
run: |
mkdir ./release/
cd ./dist/ && zip -r ../release/crx.zip ./
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Proxyverse
path: ./release/*
release-github:
name: Publish on Github Release
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ./release/
- name: Upload to release page
uses: softprops/action-gh-release@v2
with:
files: ./release/*
release-edge:
name: Publish on Edge
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ./release/
- name: Upload to MS Edge
uses: wdzeng/edge-addon@v1
with:
product-id: 6fa97660-6c21-41e4-87e6-06a88509753f
zip-path: ./release/crx.zip
client-id: ${{ secrets.EDGE_CLIENT_ID }}
client-secret: ${{ secrets.EDGE_CLIENT_SECRET }}
access-token-url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}