-
-
Notifications
You must be signed in to change notification settings - Fork 49
98 lines (81 loc) · 2.38 KB
/
extension.yaml
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: Extension CI/CD
on:
push:
paths:
- .github/workflows/extension.yaml
- extension/**
tags:
- v*
branches-ignore:
- crowdin-*
pull_request:
paths:
- .github/workflows/extension.yaml
- extension/**
defaults:
run:
working-directory: extension
shell: bash
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure cache
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
~/.config/yarn
./extension/.parcel-cache
key: ${{ runner.os }}-yarn-lint-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint the project
run: yarn lint
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure cache
uses: actions/cache@v4
with:
path: |
~/.cache/yarn
~/.config/yarn
./extension/.parcel-cache
key: ${{ runner.os }}-yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Set the version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]
then
VERSION=${GITHUB_REF/refs\/tags\/v}
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$VERSION\"/g" package.json
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$VERSION\"/g" src/manifest.json
fi
- name: Build the project
run: yarn build
- name: Upload artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
path: extension/dist/*.zip
# Add auto-publishing to AMO once web-ext officially supports and recommends that
# This also includes uploading source code because it is needed for built/bundled extensions
# See: https://github.com/mozilla/web-ext/issues/2451