-
Notifications
You must be signed in to change notification settings - Fork 348
143 lines (136 loc) · 3.83 KB
/
Copy pathdev.yml
File metadata and controls
143 lines (136 loc) · 3.83 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: dev
on:
push:
branches:
- dev
- fix/*
- feat/*
workflow_dispatch:
inputs:
platform:
description: 'Platform(amo,cws,xpi,edge,crx)'
required: true
type: string
version:
description: 'Version'
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check_changes:
runs-on: ubuntu-24.04
outputs:
locale_changed: ${{ steps.filter.outputs.locale }}
docs_changed: ${{ steps.filter.outputs.docs }}
src_changed: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
- uses: dorny/paths-filter@v4
id: filter
with:
base: ${{ github.ref_name }}
filters: |
locale:
- 'locale/**'
docs:
- 'docs/**'
src:
- 'src/**'
- 'public/**'
- 'scripts/**'
- 'tests/**'
- 'patches/**'
- 'rsbuild.config.ts'
- 'pnpm-lock.yaml'
unit-test:
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.src_changed == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 11.11.0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Test unit tests
run: npm run test:unit
build:
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.src_changed == 'true' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v6
- name: Inject Env
run: |
echo "INPUT_PLATFORM=${{ github.event.inputs.platform }}" >> $GITHUB_ENV
echo "INPUT_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- uses: pnpm/action-setup@v6
with:
version: 11.11.0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Get snapshot version
uses: FirefoxBar/extension-packer@action
with:
script: ${{ github.workspace }}/scripts/get-snapshot-version.mjs
env:
TOKEN: ${{ secrets.SNAPSHOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build And Test
uses: ./.github/actions/build-and-test
- name: Publish snapshot
uses: FirefoxBar/extension-packer@action
with:
script: ${{ github.workspace }}/scripts/pack.mjs
env:
AMO_KEY: ${{ secrets.ORG_AMO_KEY }}
AMO_SECRET: ${{ secrets.ORG_AMO_SECRET }}
CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
PACK_PLATFORM: crx
- name: Upload snapshot release
uses: actions/upload-artifact@v7
with:
name: release
retention-days: 7
path: temp/release
sync-locale:
needs: check_changes
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.locale_changed == 'true' }}
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Sort
run: node ./locale/sort-origin.js
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: sync-locale
folder: locale
clean: false
commit-message: '[skip ci] sync locale'
build-docs:
needs: check_changes
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
uses: ./.github/workflows/build-docs.yml
secrets: inherit
with:
is_prod: false