Skip to content

Commit 3883c81

Browse files
committed
Merge branch 'master' of https://github.com/lazywalker/lazydns
2 parents e688319 + d6c8004 commit 3883c81

2 files changed

Lines changed: 30 additions & 25 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ jobs:
120120
target\${{ matrix.target }}\minimal\lazydns.exe
121121
target\${{ matrix.target }}\full\lazydns.exe
122122
args: -q --best --lzma
123+
- name: Resolve version
124+
shell: bash
125+
run: |
126+
set -euo pipefail
127+
echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
123128
- name: Package release (non-Windows)
124129
if: matrix.os != 'windows-latest'
125130
shell: bash
@@ -130,10 +135,9 @@ jobs:
130135
DIR=target/${{ matrix.target }}/minimal
131136
# Ensure the executable exists
132137
ls -lah "$DIR" || true
133-
# Create an unversioned archive matching installer expectations:
134-
# lazydns-<target>.tar.gz
138+
# Versioned archive so the tap and installers can pin a release.
135139
cp config.yaml LICENSE "$DIR"/
136-
tar czf "$DIR/lazydns-${TARGET}.tar.gz" -C "$DIR" lazydns config.yaml LICENSE
140+
tar czf "$DIR/lazydns-${VERSION}-${TARGET}.tar.gz" -C "$DIR" lazydns config.yaml LICENSE
137141
138142
- name: Package release (Windows)
139143
if: matrix.os == 'windows-latest'
@@ -148,8 +152,8 @@ jobs:
148152
# Copy config and license files
149153
Copy-Item -Path "config.yaml" -Destination "$DIR/"
150154
Copy-Item -Path "LICENSE" -Destination "$DIR/"
151-
# Create an unversioned zip matching installer expectations: lazydns-<target>.zip
152-
Compress-Archive -Path "$DIR/$EXE", "$DIR/config.yaml", "$DIR/LICENSE" -DestinationPath "$DIR/lazydns-$TARGET.zip" -Force
155+
# Versioned zip so the tap and installers can pin a release.
156+
Compress-Archive -Path "$DIR/$EXE", "$DIR/config.yaml", "$DIR/LICENSE" -DestinationPath "$DIR/lazydns-$env:VERSION-$TARGET.zip" -Force
153157
154158
- name: Package release (non-Windows, full)
155159
if: matrix.os != 'windows-latest'
@@ -161,10 +165,9 @@ jobs:
161165
DIR=target/${{ matrix.target }}/full
162166
# Ensure the executable exists
163167
ls -lah "$DIR" || true
164-
# Create an unversioned archive matching installer expectations:
165-
# lazydns-full-<target>.tar.gz
168+
# Versioned archive so the tap and installers can pin a release.
166169
cp config.yaml LICENSE "$DIR"/
167-
tar czf "$DIR/lazydns-full-${TARGET}.tar.gz" -C "$DIR" lazydns config.yaml LICENSE
170+
tar czf "$DIR/lazydns-full-${VERSION}-${TARGET}.tar.gz" -C "$DIR" lazydns config.yaml LICENSE
168171
169172
- name: Package release (Windows, full)
170173
if: matrix.os == 'windows-latest'
@@ -179,36 +182,36 @@ jobs:
179182
# Copy config and license files
180183
Copy-Item -Path "config.yaml" -Destination "$DIR/"
181184
Copy-Item -Path "LICENSE" -Destination "$DIR/"
182-
# Create an unversioned zip matching installer expectations: lazydns-full-<target>.zip
183-
Compress-Archive -Path "$DIR/$EXE", "$DIR/config.yaml", "$DIR/LICENSE" -DestinationPath "$DIR/lazydns-full-$TARGET.zip" -Force
185+
# Versioned zip so the tap and installers can pin a release.
186+
Compress-Archive -Path "$DIR/$EXE", "$DIR/config.yaml", "$DIR/LICENSE" -DestinationPath "$DIR/lazydns-full-$env:VERSION-$TARGET.zip" -Force
184187
185188
- name: Upload artifact (non-Windows)
186189
if: matrix.os != 'windows-latest'
187190
uses: actions/upload-artifact@v5
188191
with:
189-
name: lazydns-${{ matrix.target }}.tar.gz
190-
path: target/${{ matrix.target }}/minimal/lazydns-${{ matrix.target }}.tar.gz
192+
name: lazydns-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
193+
path: target/${{ matrix.target }}/minimal/lazydns-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
191194

192195
- name: Upload artifact (Windows)
193196
if: matrix.os == 'windows-latest'
194197
uses: actions/upload-artifact@v5
195198
with:
196-
name: lazydns-${{ matrix.target }}.zip
197-
path: target/${{ matrix.target }}/minimal/lazydns-${{ matrix.target }}.zip
199+
name: lazydns-${{ env.VERSION }}-${{ matrix.target }}.zip
200+
path: target/${{ matrix.target }}/minimal/lazydns-${{ env.VERSION }}-${{ matrix.target }}.zip
198201

199202
- name: Upload artifact (non-Windows, full)
200203
if: matrix.os != 'windows-latest'
201204
uses: actions/upload-artifact@v5
202205
with:
203-
name: lazydns-full-${{ matrix.target }}.tar.gz
204-
path: target/${{ matrix.target }}/full/lazydns-full-${{ matrix.target }}.tar.gz
206+
name: lazydns-full-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
207+
path: target/${{ matrix.target }}/full/lazydns-full-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
205208

206209
- name: Upload artifact (Windows, full)
207210
if: matrix.os == 'windows-latest'
208211
uses: actions/upload-artifact@v5
209212
with:
210-
name: lazydns-full-${{ matrix.target }}.zip
211-
path: target/${{ matrix.target }}/full/lazydns-full-${{ matrix.target }}.zip
213+
name: lazydns-full-${{ env.VERSION }}-${{ matrix.target }}.zip
214+
path: target/${{ matrix.target }}/full/lazydns-full-${{ env.VERSION }}-${{ matrix.target }}.zip
212215

213216
- name: Find deb artifacts
214217
run: |
@@ -218,7 +221,7 @@ jobs:
218221
- name: Upload built .deb artifacts
219222
uses: actions/upload-artifact@v5
220223
with:
221-
name: lazydns-${{ matrix.target }}.deb
224+
name: lazydns-${{ env.VERSION }}-${{ matrix.target }}.deb
222225
path: |
223226
target/debian/*.deb
224227

docker/Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ RUN set -ex; \
3030
*) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \
3131
esac; \
3232
if [ "$TARGETARCH" = "arm" ]; then \
33-
BINARY_NAME="lazydns-full-${ARCH}-unknown-linux-musleabihf.tar.gz"; \
33+
SUFFIX="arm-unknown-linux-musleabihf"; \
3434
else \
35-
BINARY_NAME="lazydns-full-${ARCH}-unknown-linux-musl.tar.gz"; \
35+
SUFFIX="aarch64-unknown-linux-musl"; \
3636
fi; \
37-
BASE_URL="https://github.com/lazywalker/lazydns/releases"; \
38-
if [ "${LAZYDNS_VERSION}" != "latest" ]; then \
39-
URL="${BASE_URL}/download/${LAZYDNS_VERSION}/${BINARY_NAME}"; \
37+
if [ "${LAZYDNS_VERSION}" = "latest" ]; then \
38+
VER=$(curl -s https://api.github.com/repos/lazywalker/lazydns/releases/latest | grep -m1 '"tag_name"' | sed -E 's/.*"v?([^"]+)".*/\1/'); \
4039
else \
41-
URL="${BASE_URL}/latest/download/${BINARY_NAME}"; \
40+
VER="${LAZYDNS_VERSION#v}"; \
4241
fi; \
42+
BINARY_NAME="lazydns-full-${VER}-${SUFFIX}.tar.gz"; \
43+
BASE_URL="https://github.com/lazywalker/lazydns/releases"; \
44+
URL="${BASE_URL}/download/v${VER}/${BINARY_NAME}"; \
4345
echo "Downloading from ${URL}"; \
4446
curl -L -o lazydns-full.tar.gz "${URL}" \
4547
&& tar -xzf lazydns-full.tar.gz \

0 commit comments

Comments
 (0)