Skip to content

Commit

Permalink
Merge branch 'deno-compile'
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell-k committed Nov 22, 2023
2 parents b467aec + 1a90040 commit fa3d51b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .en.utf-8.add
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Deno
a4
caxa
28 changes: 28 additions & 0 deletions .github/workflows/deno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .github/workflows/deno.yaml
# Copyright 2023 Keith Maxwell
# SPDX-License-Identifier: CC0-1.0

name: Build

on: push # yamllint disable-line rule:truthy

jobs:
build:
runs-on: ubuntu-22.04
steps:
- { uses: actions/checkout@v3 }
- { uses: denoland/setup-deno@v1, with: { deno-version: v1.x } }
- run: deno fmt --check
- run: deno lint
- run: >-
deno compile
--allow-env
--allow-read
--allow-write
--allow-run
--allow-net
a4.js
- { uses: actions/upload-artifact@v3, with: { name: a4, path: a4 } }
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with: { files: a4 }
5 changes: 1 addition & 4 deletions .github/workflows/reuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# SPDX-License-Identifier: CC0-1.0

name: REUSE Compliance Check
on: # yamllint disable-line rule:truthy
push: { branches: [main] }
pull_request: { branches: [main] }
workflow_dispatch:
on: push # yamllint disable-line rule:truthy

jobs:
main:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.en.utf-8.add.spl
/a4
/deno.lock
/index.html
/index.pdf
/node_modules/
8 changes: 7 additions & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Upstream-Name: a4
Upstream-Contact: Keith Maxwell <[email protected]>
Source: https://github.com/maxwell-k/a4

Files: .en.utf-8.add .gitignore package.json package-lock.json README.md
Files:
.en.utf-8.add
.gitignore
README.md
deno.json
package-lock.json
package.json
Copyright: 2019 Keith Maxwell <[email protected]>
License: CC0-1.0
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ Expected output:

## Offline / Single Executable Application

This is an experimental installation method using [caxa]:
This is an experimental installation method using [Deno]:

npm ci \
&& npm exec --yes -- \
caxa --exclude .git --input . --output ~/.local/bin/a4 node "{{caxa}}/a4.js"
deno compile --allow-env --allow-read --allow-write --allow-run --allow-net a4.js \
&& ./a4 --version \
&& cp a4 ~/.local/bin

Rationale:

1. Running with `npm exec`, like under quick start, is less effective offline
2. Manually installing packages, like under testing, is time consuming

## Licence

Expand Down
2 changes: 1 addition & 1 deletion a4.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let input;
let pdf;

program
.version("0.0.3") // also update package.json
.version("0.0.4") // also update package.json
.arguments(`<source.(${extensions})> [destination.pdf]`)
.action((source, destination) => {
input = source;
Expand Down
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"imports": {
"puppeteer-core": "https://deno.land/x/[email protected]/mod.ts"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maxwell-k/a4",
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"description": "Create a PDF with puppeteer",
"main": "a4.js",
Expand Down

0 comments on commit fa3d51b

Please sign in to comment.