-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to 3.11.174 with GitHub action (#7)
- Loading branch information
1 parent
2efd869
commit 323c9c1
Showing
4 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
package-lock.json | ||
pdf.js/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters