Skip to content
Closed
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
94 changes: 94 additions & 0 deletions .github/workflows/extension-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Extension Release
on:
release:
types: [published]

jobs:
upload:
name: Upload Extension (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write

strategy:
matrix:
include:
- browser: chrome
build-cmd: pnpm --filter extension zip
zip-glob: ref-impls/extension/.output/*-chrome.zip
asset-name: tempo-wallet-chrome.zip
- browser: firefox
build-cmd: pnpm --filter extension zip:firefox
zip-glob: ref-impls/extension/.output/*-firefox.zip
asset-name: tempo-wallet-firefox.zip

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Build extension zip
run: ${{ matrix.build-cmd }}

- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
zip_file=$(ls ${{ matrix.zip-glob }})
gh release upload "${{ github.event.release.tag_name }}" \
"${zip_file}#${{ matrix.asset-name }}" \
--clobber

amend-notes:
name: Amend Release Notes
needs: upload
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Append extension install instructions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${{ github.event.release.tag_name }}"
existing=$(gh release view "$tag" --repo "${{ github.repository }}" --json body -q .body)

cat <<'EOF' >> /tmp/extension-notes.md

---

### 🧩 Browser Extension

| Browser | Download |
|---------|----------|
| Chrome | [tempo-wallet-chrome.zip](https://github.com/${{ github.repository }}/releases/download/${TAG}/tempo-wallet-chrome.zip) |
| Firefox | [tempo-wallet-firefox.zip](https://github.com/${{ github.repository }}/releases/download/${TAG}/tempo-wallet-firefox.zip) |

<details>
<summary>Install instructions</summary>

**Chrome:**
1. Download and unzip `tempo-wallet-chrome.zip`
2. Go to `chrome://extensions`
3. Enable "Developer mode"
4. Click "Load unpacked" and select the unzipped folder

**Firefox:**
1. Download and unzip `tempo-wallet-firefox.zip`
2. Go to `about:debugging#/runtime/this-firefox`
3. Click "Load Temporary Add-on"
4. Select any file in the unzipped folder
</details>
EOF

sed -i "s|\${TAG}|${tag}|g" /tmp/extension-notes.md

printf '%s\n%s' "$existing" "$(cat /tmp/extension-notes.md)" > /tmp/full-notes.md

gh release edit "$tag" \
--repo "${{ github.repository }}" \
--notes-file /tmp/full-notes.md
80 changes: 80 additions & 0 deletions .github/workflows/extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Extension
on:
push:
branches: [main]
pull_request:

concurrency:
group: extension-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
include:
- browser: chrome
build-cmd: pnpm --filter extension build
artifact-path: ref-impls/extension/.output/chrome-mv3
artifact-name: tempo-wallet-chrome
- browser: firefox
build-cmd: pnpm --filter extension build:firefox
artifact-path: ref-impls/extension/.output/firefox-mv2
artifact-name: tempo-wallet-firefox

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Build extension
run: ${{ matrix.build-cmd }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}

comment:
name: PR Comment
if: github.event_name == 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: extension-builds
message: |
### 🧩 Extension Builds

| Browser | Artifact |
|---------|----------|
| Chrome | [tempo-wallet-chrome](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) |
| Firefox | [tempo-wallet-firefox](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) |

<details>
<summary>Install instructions</summary>

**Chrome:**
1. Download and unzip `tempo-wallet-chrome`
2. Go to `chrome://extensions`
3. Enable "Developer mode"
4. Click "Load unpacked" and select the unzipped folder

**Firefox:**
1. Download and unzip `tempo-wallet-firefox`
2. Go to `about:debugging#/runtime/this-firefox`
3. Click "Load Temporary Add-on"
4. Select any file in the unzipped folder
</details>
Loading
Loading