Bump version to 0.14.0 (#688) #73
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: Browser Extension Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build-chrome-extension: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: browser-extension | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get short SHA | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: browser-extension/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build extension | |
run: npm run build:chrome | |
- name: Run tests | |
run: npm run test | |
- name: Run linting | |
run: npm run lint | |
- name: Zip Chrome Extension | |
run: npm run zip:chrome | |
- name: Unzip for artifact | |
run: | | |
mkdir -p dist/chrome-unpacked | |
unzip dist/aliasvault-browser-extension-*-chrome.zip -d dist/chrome-unpacked | |
- name: Upload dist artifact Chrome | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-chrome | |
path: browser-extension/dist/chrome-unpacked | |
outputs: | |
sha_short: ${{ steps.vars.outputs.sha_short }} | |
build-firefox-extension: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: browser-extension | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get short SHA | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: browser-extension/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build extension | |
run: npm run build:firefox | |
- name: Run tests | |
run: npm run test | |
- name: Run linting | |
run: npm run lint | |
- name: Zip Firefox Extension | |
run: npm run zip:firefox | |
- name: Unzip for artifact | |
run: | | |
mkdir -p dist/firefox-unpacked | |
unzip dist/aliasvault-browser-extension-*-firefox.zip -d dist/firefox-unpacked | |
mkdir -p dist/sources-unpacked | |
unzip dist/aliasvault-browser-extension-*-sources.zip -d dist/sources-unpacked | |
- name: Upload dist artifact Firefox | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-firefox | |
path: browser-extension/dist/firefox-unpacked | |
- name: Upload dist artifact Firefox sources | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-sources | |
path: browser-extension/dist/sources-unpacked | |
outputs: | |
sha_short: ${{ steps.vars.outputs.sha_short }} | |
build-edge-extension: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: browser-extension | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get short SHA | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: browser-extension/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build extension | |
run: npm run build:edge | |
- name: Run tests | |
run: npm run test | |
- name: Run linting | |
run: npm run lint | |
- name: Zip Edge Extension | |
run: npm run zip:edge | |
- name: Unzip for artifact | |
run: | | |
mkdir -p dist/edge-unpacked | |
unzip dist/aliasvault-browser-extension-*-edge.zip -d dist/edge-unpacked | |
- name: Upload dist artifact Edge | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', steps.vars.outputs.sha_short) || steps.vars.outputs.sha_short) }}-edge | |
path: browser-extension/dist/edge-unpacked | |
outputs: | |
sha_short: ${{ steps.vars.outputs.sha_short }} | |
upload-chrome-release-assets: | |
runs-on: ubuntu-latest | |
needs: [build-chrome-extension] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download built artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', needs.build-chrome-extension.outputs.sha_short) || needs.build-chrome-extension.outputs.sha_short) }}-chrome | |
path: browser-extension/dist/chrome-unpacked | |
- name: Zip Chrome Extension for release | |
run: | | |
cd browser-extension/dist | |
zip -r aliasvault-browser-extension-${{ github.ref_name }}-chrome.zip chrome-unpacked/* | |
- name: Upload Chrome Extension ZIP to Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: browser-extension/dist/aliasvault-browser-extension-*-chrome.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-firefox-release-assets: | |
runs-on: ubuntu-latest | |
needs: [build-firefox-extension] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download built artifact Firefox | |
uses: actions/download-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', needs.build-firefox-extension.outputs.sha_short) || needs.build-firefox-extension.outputs.sha_short) }}-firefox | |
path: browser-extension/dist/firefox-unpacked | |
- name: Download built artifact Firefox sources | |
uses: actions/download-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', needs.build-firefox-extension.outputs.sha_short) || needs.build-firefox-extension.outputs.sha_short) }}-sources | |
path: browser-extension/dist/sources-unpacked | |
- name: Zip Firefox Extensions for release | |
run: | | |
cd browser-extension/dist | |
zip -r aliasvault-browser-extension-${{ github.ref_name }}-firefox.zip firefox-unpacked/* | |
zip -r aliasvault-browser-extension-${{ github.ref_name }}-sources.zip sources-unpacked/* | |
- name: Upload Firefox Extension ZIP to Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: browser-extension/dist/aliasvault-browser-extension-*{-firefox,-sources}.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-edge-release-assets: | |
runs-on: ubuntu-latest | |
needs: [build-edge-extension] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download built artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: aliasvault-browser-extension-${{ github.event_name == 'release' && github.ref_name || (github.ref_name == 'main' && format('main-{0}', needs.build-edge-extension.outputs.sha_short) || needs.build-edge-extension.outputs.sha_short) }}-edge | |
path: browser-extension/dist/edge-unpacked | |
- name: Zip Edge Extension for release | |
run: | | |
cd browser-extension/dist | |
zip -r aliasvault-browser-extension-${{ github.ref_name }}-edge.zip edge-unpacked/* | |
- name: Upload Edge Extension ZIP to Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: browser-extension/dist/aliasvault-browser-extension-*-edge.zip | |
token: ${{ secrets.GITHUB_TOKEN }} |