-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (65 loc) · 2.27 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (65 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
# CI + prerelease builds for every push to main. Store-grade releases are
# handled by publish.yml (tag push from `pnpm release`, or version.yml).
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
# a release commit gets its build from publish.yml on the tag instead
if: 'github.event_name != ''push'' || !startsWith(github.event.head_commit.message, ''chore: release v'')'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
# build first: it generates src/auto-imports.d.ts, which typecheck needs
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm vitest run
- name: Pack zip
run: |
pnpm pack:zip
mkdir -p artifacts
mv comark-for-github.zip artifacts/
# no .crx asset: Chrome on Windows/macOS rejects non-Web-Store crx
# files (CRX_REQUIRED_PROOF_MISSING); the zip + "Load unpacked" is the
# Chrome path until the Web Store listing exists
# the xpi must come from the Firefox-flavored build
# (gecko id, background scripts instead of a service worker).
# NOTE: `pnpm build` runs `clear`, which deletes ./extension.* packs —
# that is why the chrome packs are stashed in artifacts/ first.
- name: Build (Firefox)
run: EXTENSION=firefox pnpm build
- name: Pack xpi
run: |
pnpm pack:xpi
mv comark-for-github.xpi artifacts/
- name: Resolve tag
id: tag
run: |
VERSION=$(node -p "require('./package.json').version")
echo "value=v$VERSION-build.$GITHUB_RUN_NUMBER" >> "$GITHUB_OUTPUT"
- name: Create prerelease
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ steps.tag.outputs.value }}" artifacts/* \
--title "${{ steps.tag.outputs.value }}" \
--generate-notes \
--prerelease