Skip to content

Merge pull request #493 from devmount/chores/remove-stylus #381

Merge pull request #493 from devmount/chores/remove-stylus

Merge pull request #493 from devmount/chores/remove-stylus #381

Workflow file for this run

# 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 }}