Skip to content

2.1.0

2.1.0 #4

Workflow file for this run

name: Release
on:
release:
types:
- published
jobs:
build:
name: Build (${{ matrix.targetPlatform }})
runs-on: ubuntu-latest
strategy:
matrix:
targetPlatform: [chromium, webext]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm dependencies
uses: actions/[email protected]
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-production-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-production-
${{ runner.os }}-npm-
- name: Install npm dependencies
run: npm ci --omit=dev --prefer-offline
- name: Run Webpack
run: npx webpack
env:
NODE_ENV: production
APP_VERSION: ${{ github.event.release.tag_name }}
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
SENTRY_RELEASE: ${{ github.event.repository.name }}@${{ github.event.release.tag_name }}
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
UNSPLASH_BRIDGE_BASE_HOST: ${{ vars.UNSPLASH_BRIDGE_BASE_HOST }}
UNSPLASH_DEFAULT_COLLECTION_ID: ${{ vars.UNSPLASH_DEFAULT_COLLECTION_ID }}
WEBSITE_ICONS_PROXY_BASE_HOST: ${{ vars.WEBSITE_ICONS_PROXY_BASE_HOST }}
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v4
with:
name: camellia-${{ github.event.release.tag_name }}-${{ matrix.targetPlatform }}
path: ./dist/${{ matrix.targetPlatform }}/
retention-days: 7
chrome_web_store_release:
runs-on: ubuntu-latest
name: Chrome Web Store Release
needs: [build]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: camellia-${{ github.event.release.tag_name }}-chromium
path: ./dist/
- name: Create ZIP-archive
run: zip -r camellia.zip ./dist/
- name: Upload to Chrome Web Store and release
uses: mnao305/[email protected]
with:
file-path: camellia.zip
extension-id: ${{ vars.CHROME_WEB_STORE_EXTENSION_ID }}
client-id: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
sentry_release:
runs-on: ubuntu-latest
name: Sentry Release
needs: [chrome_web_store_release]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: camellia-${{ github.event.release.tag_name }}-chromium
path: ./dist/
- name: Create Sentry release
uses: getsentry/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ github.event.repository.name }}
with:
environment: production
version: ${{ github.event.repository.name }}@${{ github.event.release.tag_name }}
sourcemaps: ./dist/
url_prefix: /