-
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (82 loc) · 3.2 KB
/
build.yml
File metadata and controls
98 lines (82 loc) · 3.2 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: 'Build extension and plugin'
on:
workflow_call:
inputs:
platform:
required: false
type: string
description: 'The platform to build the extension for; chrome, firefox, emacs, or all. Default is all.'
default: 'all'
env:
nodeVersion: 19
pnpmVersion: 8
retentionDays: 14
emacsVersion: 27.1 # min specified in emacs file
jobs:
build-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: ${{ env.pnpmVersion }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.nodeVersion }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build the extension for chrome
if: ${{ inputs.platform == 'all' || inputs.platform == 'chrome' }}
run: pnpm run build
- name: Package the extension for chrome
if: ${{ inputs.platform == 'all' || inputs.platform == 'chrome' }}
run: pnpm run package
- name: Add Chrome extension to artifacts
if: ${{ inputs.platform == 'all' || inputs.platform == 'chrome' }}
uses: actions/upload-artifact@v4
with:
name: chrome-mv3-prod.zip
path: build/chrome-mv3-prod.zip
retention-days: ${{ env.retentionDays }}
- name: Build the extension for firefox
if: ${{ inputs.platform == 'all' || inputs.platform == 'firefox' }}
run: pnpm run build --target=firefox-mv3
- name: Package the extension for firefox
if: ${{ inputs.platform == 'all' || inputs.platform == 'firefox' }}
run: pnpm run package --target=firefox-mv3
- name: Add Firefox extension to artifacts
if: ${{ inputs.platform == 'all' || inputs.platform == 'firefox' }}
uses: actions/upload-artifact@v4
with:
name: firefox-mv3-prod.zip
path: build/firefox-mv3-prod.zip
retention-days: ${{ env.retentionDays }}
- name: Set up Emacs
if: ${{ inputs.platform == 'all' || inputs.platform == 'emacs' }}
uses: jcs090218/setup-emacs@master
with:
version: ${{ env.emacsVersion }}
- name: Install Eldev
if: ${{ inputs.platform == 'all' || inputs.platform == 'emacs' }}
uses: emacs-eldev/setup-eldev@v1
- name: Build the emacs plugin
if: ${{ inputs.platform == 'all' || inputs.platform == 'emacs' }}
run: |
BUILD_OUTPUT_PATH=`eldev package --print-filename | sed -n 'x;$p'`
echo "Build_output_path=$BUILD_OUTPUT_PATH" >> "$GITHUB_ENV"
- name: Get basename
if: ${{ inputs.platform == 'all' || inputs.platform == 'emacs' }}
run: |
BUILD_BASENAME=`basename ${{ env.Build_output_path }}`
echo "Build_basename=$BUILD_BASENAME" >> "$GITHUB_ENV"
- name: Add Emacs plugin to artifacts
if: ${{ inputs.platform == 'all' || inputs.platform == 'emacs' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.Build_basename }}
path: dist/${{ env.Build_basename }}
retention-days: ${{ env.retentionDays }}