-
-
Notifications
You must be signed in to change notification settings - Fork 32
65 lines (61 loc) · 2.1 KB
/
nightly.yml
File metadata and controls
65 lines (61 loc) · 2.1 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
# This workflow will do a clean install of node dependencies
# and build the application with node
# It creates a thunderbird add-on .xpi file from it and stores it as artifact
name: Nightly build
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# create the build files and push them to CDN
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22
- name: Compute Filename
id: file
run: |
d=$(date +%s)
echo "Current timestamp is ${d}"
PACKAGE_JSON_PATH="${1-.}"
echo "Reading package.json from ${PACKAGE_JSON_PATH}/package.json"
patch=v$(cat ${PACKAGE_JSON_PATH}/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo "Got version ${patch}. Now increment it!"
[[ ${patch::-2} =~ ([^0-9].*)([0-9]+) ]]
next="${BASH_REMATCH[1]}$(( ${BASH_REMATCH[2]} + 1 ))"
echo "Assumed next version is ${next}"
filename=third-stats_${next}-alpha.${d}.xpi
echo "Built filename is ${filename}"
echo "FILENAME=${filename}" >> $GITHUB_OUTPUT
- name: Build app using NPM
run: |
npm install
npm run build
- name: Create Thunderbird add-on (.xpi)
shell: bash
run: |
cd dist/
zip -q -r ../${{ steps.file.outputs.FILENAME }} ./
- name: Upload add-on nightly build artifact
uses: actions/upload-artifact@v6
with:
name: third-stats-nightly
path: ${{ steps.file.outputs.FILENAME }}
- name: Push add-on to CDN
uses: burnett01/rsync-deployments@v8
with:
switches: -avzr --delete
path: ${{ steps.file.outputs.FILENAME }}
remote_path: ${{ secrets.CDN_PATH }}
remote_host: ${{ secrets.CDN_HOST }}
remote_port: ${{ secrets.CDN_PORT }}
remote_user: ${{ secrets.CDN_USER }}
remote_key: ${{ secrets.CDN_SSH_KEY }}
remote_key_pass: ${{ secrets.CDN_SSH_PHRASE }}