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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ jobs:
- name: Run unit tests
run: npm test

- name: Test release packaging and installer
run: |
npm run test:release
npm run test:installer

- uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3

- name: Reject signatures without the trusted workflow identity
run: npm run test:installer:signatures

- name: Build extension
run: npm run build

Expand Down
58 changes: 51 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- name: Test release validation and packaging
run: npm run test:release

- name: Test installer
run: npm run test:installer

- name: Build extension
run: npm run build

Expand Down Expand Up @@ -88,9 +91,41 @@ jobs:
if-no-files-found: ignore
retention-days: 7

sign:
name: Sign release checksums
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: github-status-extension
path: artifacts

- uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3

- name: Verify and sign all release checksums
working-directory: artifacts
run: |
shasum -a 256 -c SHA256SUMS
cosign sign-blob --yes --bundle SHA256SUMS.sigstore.json SHA256SUMS
cosign verify-blob --certificate-identity "https://github.com/$GITHUB_WORKFLOW_REF" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--bundle SHA256SUMS.sigstore.json SHA256SUMS

- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: github-status-extension-signed
path: artifacts/*
if-no-files-found: error
retention-days: 14

publish:
name: Publish GitHub release
needs: build
needs: sign
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
Expand All @@ -99,12 +134,18 @@ jobs:
- name: Download verified release assets
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: github-status-extension
name: github-status-extension-signed
path: artifacts

- name: Verify package checksum
- uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3

- name: Verify signature and package checksums
working-directory: artifacts
run: shasum -a 256 -c ./*.sha256
run: |
cosign verify-blob --certificate-identity "https://github.com/$GITHUB_WORKFLOW_REF" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--bundle SHA256SUMS.sigstore.json SHA256SUMS
shasum -a 256 -c SHA256SUMS

- name: Create draft release
env:
Expand All @@ -120,7 +161,7 @@ jobs:
release_flags=(--latest)
fi
cat > "$RUNNER_TEMP/release-notes.md" <<'NOTES'
Download the ZIP and its SHA-256 checksum below. Extract the ZIP to a folder, open chrome://extensions, enable Developer mode, and choose Load unpacked to select that folder.
Download the release assets below. Verify SHA256SUMS with cosign using the bundle and this tag's release.yml workflow identity, then verify the checksums before running install.sh. See the README for the bootstrap commands and prerequisites.

This release is for manual installation. It is not published to the Chrome Web Store. GitHub is the only supported provider in this version.
NOTES
Expand All @@ -142,9 +183,12 @@ jobs:
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
gh release download "$RELEASE_TAG" --pattern '*.zip' --pattern '*.sha256' --dir "$RUNNER_TEMP/release-verification"
gh release download "$RELEASE_TAG" --dir "$RUNNER_TEMP/release-verification"
cd "$RUNNER_TEMP/release-verification"
shasum -a 256 -c ./*.sha256
cosign verify-blob --certificate-identity "https://github.com/$GITHUB_WORKFLOW_REF" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--bundle SHA256SUMS.sigstore.json SHA256SUMS
shasum -a 256 -c SHA256SUMS

- name: Publish immutable release
env:
Expand Down
164 changes: 91 additions & 73 deletions README.md

Large diffs are not rendered by default.

18 changes: 4 additions & 14 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# GitHub icon source
# Status mark

`mark-github.svg` is the official `mark-github-16` icon from [Primer Octicons](https://github.com/primer/octicons). The exact source revision is recorded in `octicons-commit.txt`. Its MIT license is bundled in `public/licenses/octicons-LICENSE.txt` and included in the extension package.
`status-mark.svg` is an original geometric pulse mark created for this project. It represents service health and does not contain GitHub artwork. The interface uses the GitHub name only to identify the monitored service.

The build also bundles this SVG as `icons/github.svg` for the popup and settings headers. A CSS mask lets the logo follow the selected light or dark theme.

`mark-github-mask.png` is a 512 × 512 black-on-white rasterization of that SVG. It is a build source, not a runtime asset. The Go generator converts coverage to transparency and produces neutral application icons plus green, yellow, red, and gray toolbar variants. PNGs are committed so building the extension does not require Go or browser-based asset generation.

Regenerate the color variants from the mask with:
The build bundles the SVG as `icons/status.svg` for popup and settings headers. A CSS mask follows the selected theme. The Go standard-library generator renders the same geometry into neutral application PNGs and green/yellow/red/gray toolbar variants, including transparency and antialiasing.

```bash
go run scripts/icons.go
```

To regenerate the mask, use the installed Playwright Chromium (the same external tool used for browser tests):

```bash
sed 's/width="16" height="16"/width="512" height="512"/' assets/mark-github.svg > /tmp/github-status-mark.svg
npm exec --no -- playwright screenshot --channel chromium --viewport-size '512,512' file:///tmp/github-status-mark.svg assets/mark-github-mask.png
go run scripts/icons.go
```
PNGs are committed, so building the extension does not require Go. Regeneration requires no external images, fonts, rasterization tools, or network access.
Binary file removed assets/mark-github-mask.png
Binary file not shown.
1 change: 0 additions & 1 deletion assets/mark-github.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/octicons-commit.txt

This file was deleted.

1 change: 1 addition & 0 deletions assets/status-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-status-extension",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"type": "module",
"engines": {
Expand All @@ -14,6 +14,8 @@
"test": "tsc -p tsconfig.test.json && node --test .test/tests/*.test.js",
"test:e2e": "playwright test",
"test:release": "bash tests/release.test.sh",
"test:installer": "bash tests/installer.test.sh",
"test:installer:signatures": "bash tests/installer-signatures.test.sh",
"package": "npm run build && bash scripts/package.sh"
},
"devDependencies": {
Expand Down
Binary file modified public/icons/128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/attention-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/attention-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/attention-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/operational-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/operational-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/operational-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/outage-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/outage-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/outage-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/unknown-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/unknown-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/unknown-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions public/licenses/octicons-LICENSE.txt

This file was deleted.

2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "GitHub Status Indicator",
"description": "GitHub service status at a glance. No account, tracking, or setup.",
"version": "0.1.0",
"version": "0.1.1",
"minimum_chrome_version": "120",
"permissions": ["storage", "alarms"],
"host_permissions": ["https://www.githubstatus.com/*"],
Expand Down
4 changes: 2 additions & 2 deletions public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ header > div:nth-child(2) {
width: 24px;
height: 24px;
background: currentColor;
-webkit-mask: url("icons/github.svg") center / contain no-repeat;
mask: url("icons/github.svg") center / contain no-repeat;
-webkit-mask: url("icons/status.svg") center / contain no-repeat;
mask: url("icons/status.svg") center / contain no-repeat;
}
.eyebrow {
color: var(--muted);
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cd "$(dirname "$0")/.."
rm -rf dist
./node_modules/.bin/tsc
cp -R public/. dist/
cp assets/mark-github.svg dist/icons/github.svg
cp assets/status-mark.svg dist/icons/status.svg
61 changes: 25 additions & 36 deletions scripts/icons.go
Original file line number Diff line number Diff line change
@@ -1,81 +1,70 @@
//go:build ignore

// Generate transparent GitHub status icons from the checked-in Octicons mask.
// Generate the project's original pulse mark using only the Go standard library.
package main

import (
"fmt"
"image"
"image/color"
"image/png"
"math"
"os"
)

type point struct{ x, y float64 }

var pulse = []point{{3, 16}, {9, 16}, {13, 6}, {19, 26}, {23, 16}, {29, 16}}

func main() {
if err := generate(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

func generate() error {
f, err := os.Open("assets/mark-github-mask.png")
if err != nil {
return err
}
mask, err := png.Decode(f)
closeErr := f.Close()
if err != nil {
return err
}
if closeErr != nil {
return closeErr
}
palette := map[string]color.NRGBA{
"operational": {R: 35, G: 134, B: 54, A: 255},
"attention": {R: 191, G: 135, B: 0, A: 255},
"outage": {R: 207, G: 34, B: 46, A: 255},
"unknown": {R: 110, G: 119, B: 129, A: 255},
"operational": {R: 35, G: 134, B: 54, A: 255}, "attention": {R: 191, G: 135, B: 0, A: 255},
"outage": {R: 207, G: 34, B: 46, A: 255}, "unknown": {R: 110, G: 119, B: 129, A: 255},
}
for name, tint := range palette {
for _, size := range []int{16, 24, 32} {
if err := writeIcon(mask, tint, size, fmt.Sprintf("public/icons/%s-%d.png", name, size)); err != nil {
if err := writeIcon(tint, size, fmt.Sprintf("public/icons/%s-%d.png", name, size)); err != nil {
return err
}
}
}
for _, size := range []int{16, 32, 48, 128} {
if err := writeIcon(mask, palette["unknown"], size, fmt.Sprintf("public/icons/%d.png", size)); err != nil {
if err := writeIcon(palette["unknown"], size, fmt.Sprintf("public/icons/%d.png", size)); err != nil {
return err
}
}
return nil
}

func writeIcon(mask image.Image, tint color.NRGBA, size int, path string) error {
func distance(p, a, b point) float64 {
dx, dy := b.x-a.x, b.y-a.y
t := math.Max(0, math.Min(1, ((p.x-a.x)*dx+(p.y-a.y)*dy)/(dx*dx+dy*dy)))
return math.Hypot(p.x-a.x-t*dx, p.y-a.y-t*dy)
}
func writeIcon(tint color.NRGBA, size int, path string) error {
out := image.NewNRGBA(image.Rect(0, 0, size, size))
bounds := mask.Bounds()
// Area-average the high-resolution mask with transparent padding. This keeps
// the GitHub silhouette legible at 16px and avoids clipping its outer circle.
const samples = 32
const samples = 8
for y := 0; y < size; y++ {
for x := 0; x < size; x++ {
var coverage uint64
covered := 0
for sy := 0; sy < samples; sy++ {
for sx := 0; sx < samples; sx++ {
u := (float64(x) + (float64(sx)+0.5)/samples) / float64(size)
v := (float64(y) + (float64(sy)+0.5)/samples) / float64(size)
u = (u-0.5)/0.9 + 0.5
v = (v-0.5)/0.9 + 0.5
if u < 0 || u >= 1 || v < 0 || v >= 1 {
continue
p := point{(float64(x) + (float64(sx)+.5)/samples) * 32 / float64(size), (float64(y) + (float64(sy)+.5)/samples) * 32 / float64(size)}
for i := 1; i < len(pulse); i++ {
if distance(p, pulse[i-1], pulse[i]) <= 1.5 {
covered++
break
}
}
p := color.GrayModel.Convert(mask.At(bounds.Min.X+int(u*float64(bounds.Dx())), bounds.Min.Y+int(v*float64(bounds.Dy())))).(color.Gray)
coverage += uint64(255 - p.Y)
}
}
pixel := tint
pixel.A = uint8((coverage + samples*samples/2) / (samples * samples))
pixel.A = uint8((covered*255 + samples*samples/2) / (samples * samples))
out.SetNRGBA(x, y, pixel)
}
}
Expand Down
Loading
Loading