Clipper Github Release #525
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: Clipper Github Release | |
on: | |
push: | |
tags: | |
- '*standardnotes/web*' | |
workflow_dispatch: | |
jobs: | |
build: | |
defaults: | |
run: | |
working-directory: packages/clipper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Export version from package.json | |
run: | |
echo "PACKAGE_VERSION=$(grep '"version"' ./package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV | |
- name: Build web package for clipper | |
run: BUILD_TARGET=clipper yarn build:web | |
- name: Build for Chromium (MV3) | |
env: | |
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }} | |
run: | | |
EXT_TARGET=chromium yarn build-mv3 | |
cd dist | |
zip -r standard-notes-clipper-$PACKAGE_VERSION.chromium.zip * | |
mv standard-notes-clipper-$PACKAGE_VERSION.chromium.zip ../ | |
- name: Build for Firefox (MV2) | |
env: | |
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }} | |
WEB_EXT_API_KEY: ${{ secrets.AMO_WEB_EXT_API_KEY }} | |
WEB_EXT_API_SECRET: ${{ secrets.AMO_WEB_EXT_API_SECRET }} | |
run: | | |
EXT_TARGET=firefox yarn build-mv2 | |
yarn web-ext sign --source-dir dist --api-key $WEB_EXT_API_KEY --api-secret $WEB_EXT_API_SECRET --channel=listed --use-submission-api | |
mv web-ext-artifacts/*.xpi standard-notes-clipper-$PACKAGE_VERSION.firefox.xpi | |
- name: Upload | |
uses: actions/[email protected] | |
with: | |
name: assets | |
path: | | |
packages/clipper/*.chromium.zip | |
packages/clipper/*.firefox.xpi | |
publish: | |
defaults: | |
run: | |
working-directory: packages/clipper | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Export version from package.json | |
run: | |
echo "PACKAGE_VERSION=$(grep '"version"' ./package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v3 | |
with: | |
name: assets | |
path: packages/clipper/artifacts | |
- name: Generate Release Notes | |
uses: ./actions/release-notes | |
with: | |
package: clipper | |
id: release-notes | |
continue-on-error: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.CI_PAT_TOKEN }} | |
tag_name: "@standardnotes/clipper@${{ env.PACKAGE_VERSION }}" | |
name: "Clipper ${{ env.PACKAGE_VERSION }}" | |
body: ${{ steps.release-notes.outputs.result }} | |
draft: false | |
prerelease: true | |
files: packages/clipper/artifacts/* | |
- name: Publish to Chrome Web Store | |
uses: trmcnvn/chrome-addon@v2 | |
with: | |
extension: heapafmadojoodklnkhjanbinemaagok | |
zip: packages/clipper/artifacts/standard-notes-clipper-${{ env.PACKAGE_VERSION }}.chromium.zip | |
client-id: ${{ secrets.CHROME_CLIENT_ID }} | |
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} |