From 8aa8fc7d4b013274f5689b194db4186932cc4139 Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 04:51:23 +0000 Subject: [PATCH 1/6] Refactor reuse information --- .reuse/dep5 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index 3ac6a0e..c1af70e 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,6 +3,11 @@ Upstream-Name: a4 Upstream-Contact: Keith Maxwell 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 + package-lock.json + package.json Copyright: 2019 Keith Maxwell License: CC0-1.0 From ff0d68890fa7c5d29d09cd8bafb81aadac53b1ff Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 03:54:44 +0000 Subject: [PATCH 2/6] Migrate away from caxa --- .en.utf-8.add | 2 +- .gitignore | 2 ++ .reuse/dep5 | 1 + README.md | 13 +++++++++---- deno.json | 5 +++++ 5 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 deno.json diff --git a/.en.utf-8.add b/.en.utf-8.add index 7fc7509..27f844e 100644 --- a/.en.utf-8.add +++ b/.en.utf-8.add @@ -1,2 +1,2 @@ +Deno a4 -caxa diff --git a/.gitignore b/.gitignore index 0b1068b..a183214 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /.en.utf-8.add.spl +/a4 +/deno.lock /index.html /index.pdf /node_modules/ diff --git a/.reuse/dep5 b/.reuse/dep5 index c1af70e..5c98bc0 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -7,6 +7,7 @@ Files: .en.utf-8.add .gitignore README.md + deno.json package-lock.json package.json Copyright: 2019 Keith Maxwell diff --git a/README.md b/README.md index aa1dd29..fa2fd37 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..c2f5758 --- /dev/null +++ b/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "puppeteer-core": "https://deno.land/x/puppeteer@16.2.0/mod.ts" + } +} From 67a932be45cdefaeeecd792a69fa9a2c3535019f Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 04:06:17 +0000 Subject: [PATCH 3/6] Add a GitHub workflow for deno compile --- .github/workflows/deno.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/deno.yaml diff --git a/.github/workflows/deno.yaml b/.github/workflows/deno.yaml new file mode 100644 index 0000000..8c2cb61 --- /dev/null +++ b/.github/workflows/deno.yaml @@ -0,0 +1,25 @@ +# .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 } } From a7dffc7fbeda6aeddb53f42025adbd827c437308 Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 04:44:55 +0000 Subject: [PATCH 4/6] Add an action to publish a release --- .github/workflows/deno.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deno.yaml b/.github/workflows/deno.yaml index 8c2cb61..39d6eb8 100644 --- a/.github/workflows/deno.yaml +++ b/.github/workflows/deno.yaml @@ -23,3 +23,6 @@ jobs: --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 } From f0f1abc5a88b1e3390099b2e2b82cad52e3e206b Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 04:50:25 +0000 Subject: [PATCH 5/6] Simplify the criteria for running re-use --- .github/workflows/reuse.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/reuse.yaml b/.github/workflows/reuse.yaml index 0a35b85..ba8c0a0 100644 --- a/.github/workflows/reuse.yaml +++ b/.github/workflows/reuse.yaml @@ -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: From 1a9004099f8802c40c63b50bd04baad6be15e8b9 Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Wed, 22 Nov 2023 04:45:56 +0000 Subject: [PATCH 6/6] Bump version number to 0.0.4 --- a4.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/a4.js b/a4.js index df983d2..f641e61 100755 --- a/a4.js +++ b/a4.js @@ -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(` [destination.pdf]`) .action((source, destination) => { input = source; diff --git a/package.json b/package.json index d79b25b..fec0214 100644 --- a/package.json +++ b/package.json @@ -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",