Skip to content

Commit 64d572d

Browse files
authored
ci: Merge GH workflows into one ci flow + add release job
1 parent 2f35278 commit 64d572d

File tree

5 files changed

+4076
-27378
lines changed

5 files changed

+4076
-27378
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build-lint-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 18
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build
25+
run: npm run build
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Test Webpack Build
31+
run: npm run build:webpack
32+
33+
- name: Save extension zip file for releases
34+
if: github.event_name == 'release'
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: tlsn-extension-${{ github.ref_name }}.zip
38+
path: ./zip/tlsn-extension-${{ github.ref_name }}.zip
39+
if-no-files-found: error
40+
41+
release:
42+
if: github.event_name == 'release'
43+
runs-on: ubuntu-latest
44+
needs: build-lint-test
45+
steps:
46+
- name: Download extension from build-lint-test job
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: tlsn-extension-${{ github.ref_name }}.zip
50+
path: ./tlsn-extension-${{ github.ref_name }}.zip
51+
52+
- name: 📦 Add extension zip file to release
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
gh release upload "${{ github.event.release.tag_name }}" \
57+
./tlsn-extension-${{ github.ref_name }}.zip \
58+
--clobber
59+
60+
# Get tokens as documented on
61+
# * https://developer.chrome.com/docs/webstore/using-api#beforeyoubegin
62+
# * https://github.com/fregante/chrome-webstore-upload-keys?tab=readme-ov-file
63+
- name: 💨 Publish to chrome store
64+
uses: browser-actions/release-chrome-extension@latest # https://github.com/browser-actions/release-chrome-extension/tree/latest/
65+
with:
66+
extension-id: "gcfkkledipjbgdbimfpijgbkhajiaaph"
67+
extension-path: tlsn-extension-${{ github.ref_name }}.zip
68+
oauth-client-id: ${{ secrets.OAUTH_CLIENT_ID }}
69+
oauth-client-secret: ${{ secrets.OAUTH_CLIENT_SECRET }}
70+
oauth-refresh-token: ${{ secrets.OAUTH_REFRESH_TOKEN }}

.github/workflows/lint.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/releng.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)