Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
packages: write

jobs:
goreleaser:
Expand All @@ -21,7 +22,17 @@ jobs:
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
go-version: 1.22
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Test
run: go test -v ./...
Expand Down
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,57 @@ changelog:
exclude:
- '^docs:'
- '^test:'

dockers:
- image_templates:
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:{{ .Tag }}-amd64"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:latest-amd64"
dockerfile: Containerfile
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
use: buildx
goarch: amd64
extra_files:
- go.mod
- go.sum
- internal/
- opds/
- main.go
- main_test.go
- image_templates:
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:{{ .Tag }}-arm64"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:latest-arm64"
dockerfile: Containerfile
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
use: buildx
goarch: arm64
extra_files:
- go.mod
- go.sum
- internal/
- opds/
- main.go
- main_test.go

docker_manifests:
- name_template: "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:{{ .Tag }}"
image_templates:
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:{{ .Tag }}-amd64"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:{{ .Tag }}-arm64"
- name_template: "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:latest"
image_templates:
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:latest-amd64"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/dir2opds:latest-arm64"
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ RUN go build -o /app/dir2opds
# Stage 2: Final Image
FROM docker.io/alpine
COPY --from=builder /app/dir2opds /dir2opds
ENTRYPOINT ["/dir2opds"]