Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_call:
push:
branches:
- main
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release Chrome Extension

on:
release:
types:
- published

permissions:
contents: read

concurrency:
group: release-${{ github.workflow }}-${{ github.event.release.tag_name }}
cancel-in-progress: true

jobs:
quality:
uses: ./.github/workflows/ci.yml
permissions:
contents: read

build-chrome:
name: Build Chrome
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- quality
permissions:
contents: read
env:
ASSET_NAME: header-injector-chrome-${{ github.event.release.tag_name }}.zip
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false

- name: Setup Vite+
uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
with:
version: "0.1.14"
node-version: "24.14.1"
cache: true
run-install: true

- name: Build Chrome extension
run: vp run @header-injector/extension#build:chrome

- name: Package Chrome extension
working-directory: apps/extension/dist/chrome
env:
ASSET_PATH: ${{ runner.temp }}/${{ env.ASSET_NAME }}
run: zip -r "$ASSET_PATH" .

- name: Upload packaged artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
env:
ASSET_PATH: ${{ runner.temp }}/${{ env.ASSET_NAME }}
with:
name: chrome-release-asset
path: ${{ env.ASSET_PATH }}
if-no-files-found: error

upload-release-asset:
name: Upload Release Asset
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- build-chrome
permissions:
contents: write
env:
ASSET_NAME: header-injector-chrome-${{ github.event.release.tag_name }}.zip
steps:
- name: Download packaged artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: chrome-release-asset
path: ${{ runner.temp }}/release-asset

- name: Upload release asset
env:
ASSET_PATH: ${{ runner.temp }}/release-asset/${{ env.ASSET_NAME }}
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.event.release.tag_name }}
run: gh release upload "$TAG_NAME" "$ASSET_PATH" --repo "$GITHUB_REPOSITORY" --clobber