Skip to content

Merge pull request #270 from asieduernest12/master #14

Merge pull request #270 from asieduernest12/master

Merge pull request #270 from asieduernest12/master #14

name: Plasmo build chrome development relase
on:
workflow_dispatch:
push:
tags:
- '*.*.*.*-*'
branches: [plasmo]
jobs:
build:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16 ]
name: Node ${{ matrix.node }} sample
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
# rm -rf node_modules/ pnpm-lock.yaml
pnpm install
pnpm install postcss@^8 webpack@^4.0.0
- name: Build artifacts
run: |
ext_version_name=${{github.ref_name}}
echo $ext_version_name
ext_version_id=$(echo $ext_version_name | tr -d [:alpha:] | tr -d [=-=])
ext_tag=$(echo $ext_version_name | tr -d [:digit:] | tr -d [=-=] | tr -d [=.=])
echo "build jiffy-reader-development"
printf "VERSION=$ext_version_id \nVERSION_NAME=$ext_version_name \nNAME=\"Jiffy Reader $ext_tag\" \nTARGET=chrome \nDEBUG=FALSE \nSHORTCUT=\"Alt+B\"" > .env.production
cat .env.production
pnpm gh:build:development && pnpm gh:build:bookmarklet && pnpm gh:build:firefox
cd build/chrome-mv3-prod/ && zip -r "../jiffyReader-chrome-$ext_tag" ./*
cd ../firefox-mv2-prod/ && zip -r "../jiffyReader-firefox-$ext_tag.xpi" ./*
pwd
ls -hl ../../build/
echo "ext_tag=$ext_tag" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
artifacts: "build/jiffyReader-*"
token: ${{ secrets.GITHUB_TOKEN }}