-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (77 loc) · 2.59 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (77 loc) · 2.59 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
82
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
- run: npm ci
- run: npm audit --audit-level=moderate
- run: npm run verify
- run: npm run test:e2e
env:
BROWSER_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
STRICT_LOCALES: "1"
- name: Check release version
run: node -e "const p=require('./package.json'); if ('v'+p.version !== process.env.GITHUB_REF_NAME) process.exit(1)"
- name: Package extension
run: |
cd dist
zip -r "../header-patch-${GITHUB_REF_NAME}.zip" .
cd ..
sha256sum "header-patch-${GITHUB_REF_NAME}.zip" > "header-patch-${GITHUB_REF_NAME}.zip.sha256"
- name: Save release artifacts
uses: actions/upload-artifact@v7
with:
name: extension-release
path: |
header-patch-${{ github.ref_name }}.zip
header-patch-${{ github.ref_name }}.zip.sha256
if-no-files-found: error
retention-days: 14
- name: Publish GitHub Release
run: gh release create "$GITHUB_REF_NAME" "header-patch-${GITHUB_REF_NAME}.zip" "header-patch-${GITHUB_REF_NAME}.zip.sha256" --generate-notes --title "Header Patch $GITHUB_REF_NAME"
env:
GH_TOKEN: ${{ github.token }}
publish-edge:
needs: release
if: ${{ vars.EDGE_PUBLISH_ENABLED == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 22
- name: Download release package
uses: actions/download-artifact@v8
with:
name: extension-release
path: release-artifacts
- name: Upload and submit Edge update
run: npm run publish:edge -- --package "release-artifacts/header-patch-${GITHUB_REF_NAME}.zip" --notes-file docs/edge-certification-notes.txt
env:
EDGE_CLIENT_ID: ${{ vars.EDGE_CLIENT_ID }}
EDGE_PRODUCT_ID: ${{ vars.EDGE_PRODUCT_ID }}
EDGE_API_KEY_EXPIRES_AT: ${{ vars.EDGE_API_KEY_EXPIRES_AT }}
EDGE_API_KEY: ${{ secrets.EDGE_API_KEY }}