From e022f930114a57dd010a38312b45b1b3d08379ee Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 29 May 2024 02:53:50 -0700 Subject: [PATCH] Improvements to build --- .github/workflows/release.yml | 6 +++--- .goreleaser.yaml | 5 +++-- CHANGELOG.md | 11 +---------- Dockerfile | 3 +++ README.md | 5 +++++ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e88a6c5..de394ebb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,6 @@ jobs: - name: Push image run: | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # This changes all uppercase characters to lowercase. IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') # This strips the git ref prefix from the version. @@ -61,5 +60,6 @@ jobs: [ "$VERSION" == "main" ] && VERSION=latest echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION + docker buildx build --push \ + --tag $IMAGE_ID:$VERSION \ + --platform linux/amd64,linux/arm64,linux/arm/v7 . diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d8b026c7..892bcd44 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -29,9 +29,10 @@ builds: archives: - format: tar.gz # this name template makes the OS and Arch compatible with the results of uname. + # Used to start with {{ .ProjectName }} name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ + rwp_ + {{- tolower .Os }}_ {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 5563e3bd..d04ed03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,4 @@ All notable changes to this project will be documented in this file. ## [Unreleased] -### Added - -* Add the [Media Type API](https://readium.org/architecture/proposals/001-media-type.html). -* Add the file and archive fetchers of the [Fetcher API](https://readium.org/architecture/proposals/002-composite-fetcher-api.html). - -### Changed - -* Restructuring of the repo's folders -* Removal of legacy models (LCP etc.) -* Updated shared models to latest specs \ No newline at end of file +TODO \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a4fa2abe..421c7392 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # Produces very small images FROM gcr.io/distroless/static-debian12 AS packager +# Extra metadata +LABEL org.opencontainers.image.source="https://github.com/readium/go-toolkit" + # Add Fedora's mimetypes (pretty up-to-date and expansive) # since the distroless container doesn't have any. Go uses # this file as part of its mime package, and readium/go-toolkit diff --git a/README.md b/README.md index ed7efc10..2bddc6bf 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,8 @@ rwp manifest --infer-a11y=merged publication.epub | jq .metadata | `feature` | `tableOfContents` | If the publications contains a table of contents (check for the presence of a `toc` collection in RWPM) | | `feature` | `MathML` | If the publication contains any resource with MathML (check for the presence of the `contains` property where the value is `mathml` in `readingOrder` or `resources` in RWPM) | | `feature` | `synchronizedAudioText` | If the publication contains any reference to Media Overlays (TBD in RWPM) | + +### HTTP streaming of local publications + +`rwp serve` starts an HTTP server that serves EPUB, CBZ and other compatible formats from a given directory. +A log is printed to stdout. \ No newline at end of file