Skip to content

Commit 5a61eea

Browse files
authored
Merge pull request #16 from systemli/Fix-Release-Workflow
👷 Fix Release Workflow
2 parents bdaad79 + f624ee6 commit 5a61eea

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

.github/workflows/integration.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ jobs:
4141
with:
4242
go-version-file: "go.mod"
4343

44-
- name: Build
45-
run: go build
46-
47-
- name: Docker Build
48-
run: docker build .
44+
- name: Build Releases
45+
uses: goreleaser/goreleaser-action@v6.0.0
46+
with:
47+
version: "~> v2"
48+
args: release --clean --snapshot
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.env
2+
dist

.goreleaser.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ builds:
1818
dockers:
1919
- goos: linux
2020
goarch: amd64
21+
dockerfile: Dockerfile.release
2122
image_templates:
2223
- "systemli/userli-postfix-adapter:{{ .Tag }}"
2324
- "systemli/userli-postfix-adapter:{{ .Major }}"
@@ -26,6 +27,6 @@ dockers:
2627
checksum:
2728
name_template: "checksums.txt"
2829
snapshot:
29-
name_template: "{{ .Tag }}-next"
30+
version_template: "{{ .Tag }}-next"
3031
changelog:
3132
disable: true

Dockerfile.release

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM alpine:3.19 AS build
2+
3+
ENV USER=appuser
4+
ENV UID=10001
5+
6+
RUN adduser \
7+
--disabled-password \
8+
--gecos "" \
9+
--home "/nonexistent" \
10+
--shell "/sbin/nologin" \
11+
--no-create-home \
12+
--uid "${UID}" \
13+
"${USER}"
14+
15+
FROM scratch AS runtime
16+
17+
COPY userli-postfix-adapter /userli-postfix-adapter
18+
19+
COPY --from=build /etc/passwd /etc/passwd
20+
COPY --from=build /etc/group /etc/group
21+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
22+
23+
USER appuser:appuser
24+
25+
ENTRYPOINT ["/userli-postfix-adapter"]

0 commit comments

Comments
 (0)