Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
99 changes: 0 additions & 99 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🏗️ Build

on:
push:
branches: [main]
pull_request: ~


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: 📦 Install Mise
run: |
curl https://mise.run | sh
mise install

- name: Install dependencies
run: sudo apt install wv unrtf tidy

- name: Build
run: mise build

- name: Test
run: mise test
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 🚀 Publish Release

on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+(-alpha[0-9]+|-beta[0-9]+)?'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: 📦 Install Mise
run: |
curl https://mise.run | sh
mise install

- name: ⚙️ Set up QEMU
uses: docker/setup-qemu-action@v3

- name: ⚙️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🔑 Get signing keys
run: |
echo "${{ secrets.SKPR_PRIVATE_KEY }}" > skpr.rsa
echo "${{ secrets.SKPR_PUBLIC_KEY }}" > skpr.rsa.pub
chmod 600 skpr.rsa skpr.rsa.pub

- name: 🚀 Publish Release
run: mise release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 🚮 Delete signing key
if: always()
run: rm -f skpr.rsa

- name: 🔑 Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: 📤 Upload APKs to S3
run: |
VERSION=${GITHUB_TAG}
aws s3 sync \
./dist/docconv_${VERSION}_linux_arm64.apk \
s3://package-skpr-io/docconv/${VERSION}/aarch64/docconv_${VERSION}.apk \
--acl public-read \
--cache-control "max-age=86400" \
--delete
aws s3 sync \
./dist/docconv_${VERSION}_linux_amd64.apk \
s3://package-skpr-io/docconv/${VERSION}/x86_64/docconv_${VERSION}.apk \
--acl public-read \
--cache-control "max-age=86400" \
--delete
# upload public key for validating repository packages.
aws s3 cp skpr.rsa.pub s3://package-skpr-io/docconv/skpr.rsa.pub --acl public-read

- name: ☁️ Invalidate CloudFront Cache
run: |
VERSION=${GITHUB_TAG}
aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths /docconv/${VERSION}/* /docconv/skpr.rsa.pub
26 changes: 26 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 👨‍🔧 Build Snapshot Release

on:
workflow_dispatch: ~

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: 📦 Install Mise
run: |
curl https://mise.run | sh
mise install

- name: ⚙️ Set up QEMU
uses: docker/setup-qemu-action@v3

- name: ⚙️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🚀 Create Snapshot Release
run: mise snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

sajari-convert
*tests/
skpr.rsa
skpr.rsa.pub
/dist
/vendor
53 changes: 53 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project_name: docconv

version: 2

builds:
- main: ./docd
binary: docconv
ldflags:
- -extldflags '-static'
env:
- CGO_ENABLED=0
goos: [ linux ]
goarch: [ amd64, arm64 ]

release:
prerelease: auto
name_template: "docconv {{.Version}}"
github:
owner: skpr
name: docconv

nfpms:
- package_name: docconv
license: MIT
maintainer: admin@skpr.com.au
homepage: https://github.com/skpr/docconv
description: Fork of https://github.com/sajari/docconv to add additional package formats.
formats: [ apk ]
dependencies:
- tesseract-ocr
- poppler-utils
overrides:
apk:
dependencies:
- tesseract-ocr
- tesseract-ocr-dev
- poppler-utils
apk:
signature:
key_file: skpr.rsa

dockers_v2:
- images:
- "docker.io/skpr/docconv"
- "ghcr.io/skpr/docconv"
tags:
- "{{ .Version }}"
- "latest"
platforms:
- linux/amd64
- linux/arm64
build_args:
ALPINE_VERSION: "3.23"
25 changes: 25 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tools]
go = "1.25"
"ubi:goreleaser/goreleaser" = "latest"

[env]
CGO_ENABLED=0
LGFLAGS="-extldflags '-static'"

[tasks.build]
description = "Build the application"
run = '''
go build -v -o ./dist/docconv ./docd
'''

[tasks.test]
description = "Run tests"
run = "go test -v ./..."

[tasks.snapshot]
description = "Create a snapshot release with Goreleaser"
run = "goreleaser release --snapshot --clean"

[tasks.release]
description = "Create a release with Goreleaser"
run = "goreleaser release --clean"
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

31 changes: 6 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
ARG alpine_version=3.21
FROM golang:1.24-alpine${alpine_version} as build
ARG ALPINE_VERSION=3.23
FROM alpine:$ALPINE_VERSION

RUN apk add make \
cmake \
gcc \
g++ \
poppler-utils \
wv \
lynx \
tesseract-ocr-dev
RUN apk add --no-cache tesseract-ocr tesseract-ocr-dev poppler-utils

WORKDIR /go/src/code.sajari.com/docconv
COPY . /go/src/code.sajari.com/docconv

RUN go build -o dist/docconv -tags ocr code.sajari.com/docconv/docd

ARG alpine_version=3.21
FROM alpine:${alpine_version}

RUN apk add tesseract-ocr \
tesseract-ocr-dev \
poppler-utils
Comment on lines -21 to -23
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-add this


COPY --from=build /go/src/code.sajari.com/docconv/dist/docconv /usr/local/bin/docconv

ENTRYPOINT ["/usr/local/bin/docconv"]
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/docconv /usr/bin/docconv
ENTRYPOINT ["/usr/bin/docconv"]
19 changes: 0 additions & 19 deletions Makefile

This file was deleted.

Loading