Skip to content

Commit 1f0b5bd

Browse files
author
kennethdashensheridan
committed
Fix Debian package build version handling
1 parent dce14f8 commit 1f0b5bd

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/nix-release.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
tags:
66
- "v*.*.*"
77
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version for manual builds (e.g., 0.1.11)'
11+
required: false
12+
default: 'dev'
813

914
# Prevent concurrent builds
1015
concurrency:
@@ -26,7 +31,14 @@ jobs:
2631

2732
- name: Get version from tag
2833
id: version
29-
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
34+
run: |
35+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
36+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
37+
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]] && [[ "${{ github.event.inputs.version }}" != "dev" ]]; then
38+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
39+
else
40+
echo "version=dev-${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
41+
fi
3042
3143
- name: Check if release exists
3244
id: check_release
@@ -122,7 +134,10 @@ jobs:
122134
- name: Build Debian package
123135
run: |
124136
nix build .#deb --print-build-logs
125-
cp -L result/*.deb hardware-report_${{ needs.create-release.outputs.version }}_amd64.deb
137+
# Find the actual deb file name
138+
DEB_FILE=$(ls result/*.deb | head -n1)
139+
echo "Found deb file: $DEB_FILE"
140+
cp -L "$DEB_FILE" hardware-report_${{ needs.create-release.outputs.version }}_amd64.deb
126141
127142
- name: Generate checksums
128143
run: |

0 commit comments

Comments
 (0)