Skip to content

Commit f0939b3

Browse files
committed
Optimize release process
1 parent aebc545 commit f0939b3

3 files changed

Lines changed: 73 additions & 17 deletions

File tree

.github/workflows/release.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ jobs:
4343
version: latest
4444
args: release --clean
4545
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
4847

4948
# Prepare a clean binary layout for the multi-arch Docker build.
5049
# Goreleaser outputs to dist/kefw2ui_linux_amd64_v1/ and
@@ -68,19 +67,19 @@ jobs:
6867
username: ${{ github.actor }}
6968
password: ${{ secrets.GITHUB_TOKEN }}
7069

71-
- name: Docker meta
72-
id: meta
73-
uses: docker/metadata-action@v5
74-
with:
75-
images: ghcr.io/hilli/kefw2ui
76-
tags: |
77-
type=semver,pattern={{version}}
78-
type=semver,pattern={{major}}.{{minor}}
79-
type=raw,value=latest,enable={{is_default_branch}}
80-
labels: |
81-
org.opencontainers.image.title=kefw2ui
82-
org.opencontainers.image.description=Web UI for controlling KEF W2 speakers
83-
org.opencontainers.image.source=https://github.com/hilli/kefw2ui
70+
# - name: Docker meta
71+
# id: meta
72+
# uses: docker/metadata-action@v5
73+
# with:
74+
# images: ghcr.io/hilli/kefw2ui
75+
# tags: |
76+
# type=semver,pattern={{version}}
77+
# type=semver,pattern={{major}}.{{minor}}
78+
# type=raw,value=latest,enable={{is_default_branch}}
79+
# labels: |
80+
# org.opencontainers.image.title=kefw2ui
81+
# org.opencontainers.image.description=Web UI for controlling KEF W2 speakers
82+
# org.opencontainers.image.source=https://github.com/hilli/kefw2ui
8483

8584
- name: Build and push Docker image
8685
uses: docker/build-push-action@v6

.goreleaser.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ builds:
1919
goos:
2020
- linux
2121
- darwin
22+
- windows
2223
goarch:
2324
- amd64
2425
- arm64
26+
goarm:
27+
- 7
2528
mod_timestamp: "{{ .CommitTimestamp }}"
2629
flags:
2730
- -trimpath
@@ -71,3 +74,53 @@ homebrew_casks:
7174

7275
changelog:
7376
disable: true
77+
78+
nfpms:
79+
- file_name_template: "{{ .ConventionalFileName }}"
80+
id: packages
81+
homepage: https://github.com/hilli/kefw2ui
82+
description: |-
83+
Web UI for controlling KEF W2 speakers (LSX Wireless II (LT)/LS50 Wireless II/LS60 Wireless)
84+
maintainer: Jens Hilligsøe <kefw2@hilli.dk>
85+
license: MIT
86+
vendor: Jens Hilligsøe
87+
bindir: /usr/bin
88+
section: utils
89+
contents:
90+
- src: ./LICENSE
91+
dst: /usr/share/doc/kefw2/copyright
92+
file_info:
93+
mode: 0644
94+
formats:
95+
- apk
96+
- deb
97+
- rpm
98+
- archlinux
99+
deb:
100+
lintian_overrides:
101+
- statically-linked-binary
102+
- changelog-file-missing-in-native-package
103+
104+
dockers_v2:
105+
- images:
106+
- "ghcr.io/hilli/kefw2ui"
107+
id: kefw2ui
108+
dockerfile: Dockerfile.goreleaser
109+
platforms:
110+
- linux/amd64
111+
- linux/arm64
112+
tags:
113+
- "v{{.Version}}"
114+
- latest
115+
- "v{{.Major}}.{{.Minor}}"
116+
sbom: true
117+
labels:
118+
"org.opencontainers.image.description": "Web UI for controlling KEF W2 speakers"
119+
"org.opencontainers.image.created": "{{.Date}}"
120+
"org.opencontainers.image.name": "{{.ProjectName}}"
121+
"org.opencontainers.image.revision": "{{.FullCommit}}"
122+
"org.opencontainers.image.version": "{{.Version}}"
123+
"org.opencontainers.image.source": "{{.GitURL}}"
124+
125+
snapshot:
126+
version_template: "{{ incpatch .Version }}"

Dockerfile.goreleaser

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ RUN apk add --no-cache ca-certificates tzdata
99
RUN adduser -D -u 1000 kefw2ui
1010
RUN mkdir -p /home/kefw2ui/.config/kefw2 /home/kefw2ui/.cache/kefw2 && chown -R kefw2ui:kefw2ui /home/kefw2ui
1111

12-
ARG TARGETARCH
13-
COPY dist/linux_${TARGETARCH}/kefw2ui /usr/local/bin/kefw2ui
12+
# ARG TARGETARCH
13+
# COPY dist/kefw2ui_linux_${TARGETARCH}/kefw2ui /usr/local/bin/kefw2ui
14+
15+
RUN echo dist/${TARGETPLATFORM}/kefw2ui /usr/bin/kefw2ui
16+
ARG TARGETPLATFORM
17+
COPY ${TARGETPLATFORM}/kefw2ui /usr/bin/kefw2ui
1418

1519
USER kefw2ui
1620
WORKDIR /home/kefw2ui

0 commit comments

Comments
 (0)