mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2026-01-11 16:17:04 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b92336ba1 | ||
|
|
a6ad1dada3 | ||
|
|
17fe01f27c | ||
|
|
4fa3014d80 | ||
|
|
a47af5a7a8 | ||
|
|
d7f13132f4 | ||
|
|
a8587f3f1f | ||
|
|
12817b1bff | ||
|
|
19dcf9d40b | ||
|
|
a7fa5bd0c7 |
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -21,8 +21,8 @@ jobs:
|
||||
|
||||
- name: Setup test environment
|
||||
run: |
|
||||
go build -tags testsetup -o test-setup ./cmd/test-setup
|
||||
./test-setup
|
||||
go build -tags encoder_setup -o encoder-setup ./cmd/encoder-setup
|
||||
./encoder-setup
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
@@ -5,6 +5,15 @@ release:
|
||||
github:
|
||||
owner: belphemur
|
||||
name: CBZOptimizer
|
||||
archives:
|
||||
- ids:
|
||||
- cbzoptimizer
|
||||
formats: ["tar.zst"]
|
||||
format_overrides:
|
||||
- # Which GOOS to override the format for.
|
||||
goos: windows
|
||||
formats: ["zip"] # Plural form, multiple formats. Since: v2.6
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
@@ -44,6 +53,25 @@ builds:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
- id: encoder-setup
|
||||
main: cmd/encoder-setup/main.go
|
||||
binary: encoder-setup
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
# ensures mod timestamp to be the commit timestamp
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
flags:
|
||||
# trims path
|
||||
- -trimpath
|
||||
tags:
|
||||
- encoder_setup
|
||||
ldflags:
|
||||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
# config the checksum filename
|
||||
# https://goreleaser.com/customization/checksum
|
||||
checksum:
|
||||
@@ -71,6 +99,7 @@ dockers_v2:
|
||||
- id: cbzoptimizer-image
|
||||
ids:
|
||||
- cbzoptimizer
|
||||
- encoder-setup
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@@ -5,8 +5,11 @@ ARG APP_PATH=/usr/local/bin/CBZOptimizer
|
||||
ENV USER=abc
|
||||
ENV CONFIG_FOLDER=/config
|
||||
ENV PUID=99
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends adduser && \
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update && apt-get install -y --no-install-recommends adduser && \
|
||||
addgroup --system users && \
|
||||
adduser \
|
||||
--system \
|
||||
@@ -19,14 +22,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends adduser && \
|
||||
|
||||
COPY ${TARGETPLATFORM}/CBZOptimizer ${APP_PATH}
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
apt-get update && \
|
||||
apt-get full-upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
inotify-tools \
|
||||
bash \
|
||||
ca-certificates \
|
||||
bash-completion && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
chmod +x ${APP_PATH} && \
|
||||
${APP_PATH} completion bash > /etc/bash_completion.d/CBZOptimizer.bash
|
||||
|
||||
VOLUME ${CONFIG_FOLDER}
|
||||
|
||||
USER ${USER}
|
||||
|
||||
# Need to run as the user to have the right config folder created
|
||||
RUN --mount=type=bind,source=${TARGETPLATFORM},target=/tmp/target \
|
||||
/tmp/target/encoder-setup
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/CBZOptimizer"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//go:build testsetup
|
||||
// +build testsetup
|
||||
//go:build encoder_setup
|
||||
// +build encoder_setup
|
||||
|
||||
package main
|
||||
|
||||
Reference in New Issue
Block a user