-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (171 loc) · 4.75 KB
/
Copy pathdev.yml
File metadata and controls
179 lines (171 loc) · 4.75 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: dev
on:
push:
branches:
- dev
- fix/*
- feat/*
workflow_dispatch:
inputs:
platform:
description: 'Platform(amo,cws,xpi,edge)'
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/**'
- 'patches/**'
- 'rsbuild.config.ts'
- 'pnpm-lock.yaml'
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
- 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.ORG_EXT_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: ./.github/actions/build
- 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 }}
PACK_PLATFORM: xpi
- name: Upload snapshot release
uses: actions/upload-artifact@v4
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
runs-on: ubuntu-24.04
if: ${{ needs.check_changes.outputs.docs_changed == 'true' }}
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 11
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install base dependencies
run: pnpm i --frozen-lockfile
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE/docs
pnpm i --frozen-lockfile
- name: Build
run: |
cd $GITHUB_WORKSPACE/docs
npm run build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: docs
retention-days: 1
path: docs/doc_build
deploy-docs-cloudflare:
needs: build-docs
runs-on: ubuntu-24.04
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Download
uses: actions/download-artifact@v5
with:
name: docs
path: docs
- name: Deploy Cloudflare Pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.ORG_CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.ORG_CF_ACCOUNT_ID }}
run: npx wrangler@3 pages deploy docs --project-name=${{ vars.CF_PAGE_NAME }} --branch=dev
deploy-docs-eo:
needs: build-docs
runs-on: ubuntu-24.04
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Download
uses: actions/download-artifact@v5
with:
name: docs
path: docs
- name: Deploy EdgeOne Pages
run: npx edgeone pages deploy $GITHUB_WORKSPACE/docs -n ${{ vars.EO_PAGE_NAME }} -t ${{ secrets.ORG_EO_PAGE_TOKEN }} -e preview