-
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (74 loc) · 2.56 KB
/
publish.yml
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
83
84
85
86
87
88
name: Publish Extension
on:
workflow_dispatch:
inputs:
version:
description: "Version, i.e. 0.2.1"
required: true
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Set Extension Version
shell: bash
run: echo EXTENSION_VERSION="${{ inputs.version }}" >> $GITHUB_ENV
# Get the code
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Enable corepack
run: corepack enable # Enables use of pnpm
- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ">= 20.12.2"
# Install dependencies
- name: Install NPM Deps
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Test
run: pnpm run test:ci
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Build
env:
EXTENSION_VERSION: ${{ env.EXTENSION_VERSION }}
run: pnpm run build
- name: GitHub Tag Name
env:
EXTENSION_VERSION: ${{ env.EXTENSION_VERSION }}
run: |
echo "EXTENSION_VERSION: $EXTENSION_VERSION"
- name: Create GitHub release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
id: create_release
with:
generateReleaseNotes: true
artifacts: gauntface-pin-it-extension.zip
artifactContentType: application/zip
makeLatest: true
name: "v${{ env.EXTENSION_VERSION }}"
tag: "${{ env.EXTENSION_VERSION }}"
- name: Upload sourcemaps to Sentry
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./sentry-upload.js
- name: Upload extension to Chrome Web Store
env:
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
run: |
pnpm run chrome-webstore-upload upload \
--auto-publish \
--source gauntface-pin-it-extension.zip \
--extension-id $EXTENSION_ID \
--client-id $CLIENT_ID \
--client-secret $CLIENT_SECRET \
--refresh-token $REFRESH_TOKEN