Skip to content

Commit

Permalink
Custom-build everything
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Feb 6, 2024
1 parent a00c537 commit 4d85928
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 30 deletions.
4 changes: 0 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
lib/.gitkeep export-ignore
node_modules export-ignore
package.json export-ignore
package-lock.json export-ignore
webpack.config.js export-ignore
87 changes: 76 additions & 11 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,70 @@ on: # yamllint disable-line rule:truthy
- '*'
workflow_dispatch:

env:
HLJS_VERSION: 11.9.0
PAKO_VERSION: 2.1.0

jobs:
build-hljs:
name: Build dependencies
runs-on: [ubuntu-latest]
strategy:
fail-fast: false

steps:
- uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/checkout@v4
with:
repository: 'highlightjs/highlight.js'
ref: "v$HLJS_VERSION"

- name: Custom build Highlight.js
run: |
node tools/build.js xml properties http
- name: 'Upload Hightlight.js build'
uses: actions/upload-artifact@v4
with:
name: hljs
path: build/highlight.min.js
retention-days: 1

build-pako:
name: Build dependencies
runs-on: [ubuntu-latest]
strategy:
fail-fast: false

steps:
- uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/checkout@v4
with:
repository: 'nodeca/pako'
ref: $PAKO_VERSION

- name: Custom build Pako
run: |
npx npm-check-updates -u
# Make sure the lock-file is up to date before we run clean-install
npm install --package-lock-only
npm clean-install
npm audit fix
npm run build
- name: 'Upload Pako build'
uses: actions/upload-artifact@v4
with:
name: pako
path: build/pako.js
retention-days: 1

build:
name: Build release
runs-on: [ubuntu-latest]
Expand All @@ -26,20 +89,22 @@ jobs:
- name: Fetch changes
# Without fetching, we might miss new tags due to caching in Github Actions
run: git fetch --all
- uses: actions/setup-node@v4

- uses: actions/download-artifact@v4
with:
node-version: 20
name: hljs
path: lib/

- name: Install & build assets
run: |
npx npm-check-updates -u
# Make sure the lock-file is up to date before we run clean-install
npm install --package-lock-only
npm clean-install
npm audit fix
- uses: actions/download-artifact@v4
with:
name: pako
path: lib/

cp node_modules/@highlightjs/cdn-assets/highlight.min.js lib/
cp node_modules/pako/dist/pako_inflate.js lib/pako_inflate.min.js
- uses: geekyeggo/delete-artifact@v4
with:
name: |
hljs
pako
# Store the version, stripping any v-prefix
- name: Write release version
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
node_modules
package-lock.json
lib/*.js
13 changes: 0 additions & 13 deletions package.json

This file was deleted.

0 comments on commit 4d85928

Please sign in to comment.