-
-
Notifications
You must be signed in to change notification settings - Fork 29
70 lines (61 loc) · 2.03 KB
/
build-pr-review-both-browsers.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
name: "Build For PR Review - Both Browsers"
on:
pull_request:
branches:
- main
permissions:
actions: write
issues: write
pull-requests: write
contents: write
repository-projects: write
jobs:
chrome-publish:
name: "Build For PR Review"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Development Branch"
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "Setup Node version"
uses: actions/setup-node@v3
with:
node-version: 20.9.0
- name: Get commit SHA
shell: bash
run: |
echo "setting variables"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: "Build and Test"
run: |
cd browser-extension/plugin
ls
pwd
npm install
npm run build
mv dist/ extension-chrome/
npm run build:firefox
mv dist/ extension-firefox/
- name: "Upload dist folder as artifact"
uses: actions/upload-artifact@v3
with:
name: extension-artifacts
path: |
browser-extension/plugin/extension-firefox/
browser-extension/plugin/extension-chrome/
# - name: Debug GitHub Token Permissions
# run: echo ${{ secrets.GITHUB_TOKEN }}
# - name: Create PR Comment with Artifact Link
# uses: actions/github-script@v5
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const artifact_url = `https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/runs/${{ github.run_id }}`;
# const comment_body = `🛠 Your build files are available [here](${artifact_url}).`;
# await github.rest.issues.createComment({
# issue_number: context.payload.pull_request.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: comment_body
# });