Skip to content

Commit

Permalink
Updates to 3.11.174 with GitHub action (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mradcliffe authored Jul 13, 2024
1 parent 2efd869 commit 323c9c1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "build pdfjs"

on:
push:
branches:
- main

permissions:
contents: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Installs jq
run: |
sudo apt-get update
sudo apt-get -y install jq
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Get package.json version
run: |
echo "PDFJS_VERSION=v$(jq .version package.json | sed 's#\": ##g')" >> $GITHUB_ENV
- name: Get latest pdf.js source
run: |
git clone --depth 5 --branch ${{ env.PDFJS_VERSION }} https://github.com/mozilla/pdf.js.git
- name: Install pdf.js dependencies
run: |
cd pdf.js
npm install
cd ..
- name: Install pdfjs-dist-viewer-min dependencies
run: npm install
- name: Build pdf.js minified
run: |
npx gulp --cwd pdf.js minified
- name: Deploy into build/minified
run: |
rsync -rtlDPvc --delete pdf.js/build/minified/ build/minified/
rsync -rtlDPvc --delete pdf.js/build/default_preferences/minified/ build/default_preferences/minified/web/
- name: Commit and tag if there are changes
run: |
if [ -n "$(git status --porcelain)" ]; then
git config user.name 'github-actions'
git config user.email '[email protected]'
git add -A
git commit -m "Build of ${{ env.PDFJS_VERSION }}"
git tag ${{ env.PDFJS_VERSION }}
git push origin ${{ env.PDFJS_VERSION }} -f
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
package-lock.json
pdf.js/
8 changes: 4 additions & 4 deletions build/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.12.313",
"build": 313,
"commit": "a2ae56f39"
}
"version": "3.11.174",
"build": 174,
"commit": "ce87167"
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pdfjs-dist-viewer-min",
"version": "2.12.313",
"version": "3.11.174",
"description": "Generic minified build of Mozilla's PDF.js library including the viewer component.",
"repository": {
"type": "git",
Expand All @@ -20,5 +20,8 @@
"bugs": {
"url": "https://github.com/mozilla/pdf.js/issues"
},
"homepage": "http://mozilla.github.io/pdf.js/"
"homepage": "http://mozilla.github.io/pdf.js/",
"devDependencies": {
"gulp": "^5.0.0"
}
}

0 comments on commit 323c9c1

Please sign in to comment.