Skip to content

Commit

Permalink
ci: run build on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vitonsky committed Jun 3, 2024
1 parent ddd9a0e commit 1e8c951
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
30 changes: 30 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Linguist for all platforms
description: ""
runs:
using: composite
steps:
- uses: actions/setup-node@v2
with:
node-version: "14"

- name: Install packages
shell: bash
run: npm install

- name: Compile third party with docker
shell: bash
run: make buildThirdparty

- name: Build app
shell: bash
run: make build

- name: Build CRX file for chromium
shell: bash
working-directory: "./build"
env:
CHROMIUM_CRX_PEM: ${{ secrets.CHROMIUM_CRX_PEM }}
run: |
echo "$CHROMIUM_CRX_PEM" > ./crx.pem
npx crx pack chromium -o linguist.crx -p ./crx.pem
ls -al ./
47 changes: 7 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"

workflow_dispatch:

Expand All @@ -14,44 +14,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install packages
run: npm install

- name: Run tests
run: npm test

- name: Compile third party with docker
working-directory: './thirdparty/bergamot'
run: |
make dockerBuildContainer
make dockerRunContainer
- name: Build docker image
run: make dockerBuildContainer

- name: Build app with docker
run: make dockerRunContainer

- name: Change build dir owner
working-directory: './build'
run: sudo chown -R $(id -u):$(id -g) .

- name: Build CRX file for chromium
working-directory: './build'
env:
CHROMIUM_CRX_PEM: ${{ secrets.CHROMIUM_CRX_PEM }}
run: |
echo "$CHROMIUM_CRX_PEM" > ./crx.pem
npx crx pack chromium -o linguist.crx -p ./crx.pem
ls -al ./
- uses: ./.github/actions/build

# Place to stop for DRY run
- name: Build XPI file for firefox
working-directory: './build'
working-directory: "./build"
env:
AMO_KEY: ${{ secrets.AMO_KEY }}
AMO_SECRET: ${{ secrets.AMO_SECRET }}
Expand All @@ -68,19 +35,19 @@ jobs:
build/AMO/linguist.xpi
build/linguist.crx
build/*.zip
- name: Build static files for GitHub Pages
working-directory: './build'
working-directory: "./build"
run: |
mkdir ./site
node ../scripts/genCrxUpdateManifest.js > ./site/chromium_updates.xml
# TODO: build index.html with landing page
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: [email protected]
build_dir: './build/site'
build_dir: "./build/site"
branch: gh-pages
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:

- name: Run tests
run: npm test

- uses: ./.github/actions/build

0 comments on commit 1e8c951

Please sign in to comment.