Skip to content

Commit fa5957d

Browse files
authored
Add support to publish image via goreleaser (#138)
1 parent e5b6fc6 commit fa5957d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
rm -rf upx-3.96-amd64_linux
2828
rm -rf xvf upx-3.96-amd64_linux.tar.xz
2929
upx -V
30+
- name: Image Registry Login
31+
run: |
32+
docker login --username ${{ secrets.DOCKER_HUB_USER }} --password ${{secrets.DOCKER_HUB_TOKEN}}
33+
docker login ghcr.io/linuxsuren --username linuxsuren --password ${{secrets.GH_PUBLISH_SECRETS}}
3034
- name: Run GoReleaser
3135
uses: goreleaser/[email protected]
3236
with:

.goreleaser.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,19 @@ nfpms:
8383
darwin: macOS
8484
linux: linux
8585
windows: windows
86+
dockers:
87+
- goos: linux
88+
goarch: amd64
89+
image_templates:
90+
- "surenpi/hd:latest"
91+
- "surenpi/hd:{{.Tag}}"
92+
- "ghcr.io/linuxsuren/hd:latest"
93+
- "ghcr.io/linuxsuren/hd:{{.Tag}}"
94+
build_flag_templates:
95+
- "--pull"
96+
- "--label=org.opencontainers.image.created={{.Date}}"
97+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
98+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
99+
- "--label=org.opencontainers.image.version={{.Version}}"
100+
- "--label=org.opencontainers.image.source=https://github.com/LinuxSuRen/http-downloader"
101+
- "--platform=linux/arm64"

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine:3.10
2+
3+
COPY hd /usr/bin/hd
4+
5+
CMD ["hd"]

0 commit comments

Comments
 (0)