@@ -2,150 +2,41 @@ name: Build Release Artifacts
22
33on :
44 workflow_dispatch :
5- inputs :
6- version :
7- description : ' Version to build (leave empty to auto-detect from code)'
8- required : false
9- type : string
105
116permissions :
127 contents : read
138
149jobs :
1510 build-artifacts :
16- name : Build ${{ matrix.platform }} binary
11+ name : Build ${{ matrix.os }} binary
1712 runs-on : ${{ matrix.os }}
1813 strategy :
1914 fail-fast : false
2015 matrix :
21- include :
22- # Linux x86_64
23- - os : ubuntu-latest
24- platform : linux-x86_64
25- shell : bash
26-
27- # Linux ARM64
28- - os : ubuntu-24.04-arm
29- platform : linux-arm64
30- shell : bash
31-
32- # macOS Intel x86_64
33- - os : macos-15-intel
34- platform : darwin-x86_64
35- shell : bash
36-
37- # macOS Apple Silicon ARM64
38- - os : macos-latest
39- platform : darwin-arm64
40- shell : bash
41-
42- # Windows x86_64
43- - os : windows-latest
44- platform : win-amd64
45- shell : bash
46-
47- # Windows ARM64
48- - os : windows-11-arm
49- platform : win-arm64
50- shell : bash
16+ os : [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm]
5117
5218 defaults :
5319 run :
54- shell : ${{ matrix.shell }}
20+ shell : bash
5521
5622 steps :
57- - name : Checkout code
58- uses : actions/checkout@v5
23+ - uses : actions/checkout@v5
5924
60- - name : Set up Python 3.14
61- uses : actions/setup-python@v6
25+ - uses : actions/setup-python@v6
6226 with :
6327 python-version : " 3.14"
6428 cache : ' pip'
6529 cache-dependency-path : ' requirements.txt'
6630
67- - name : Install build dependencies
68- run : |
69- python -m pip install --upgrade pip || exit 1
70- pip install virtualenv || exit 1
71-
72- - name : Install UPX (Ubuntu only)
31+ - name : Install UPX (Linux only)
7332 if : runner.os == 'Linux'
74- run : |
75- sudo apt-get update
76- sudo apt-get install -y upx
77-
78- - name : Extract version from code
79- id : get_version
80- run : |
81- if [ -n "${{ inputs.version }}" ]; then
82- VERSION="${{ inputs.version }}"
83- else
84- VERSION=$(python3 -c "import sys; sys.path.insert(0, '.'); from dnsdiag.shared import __version__; print(__version__)")
85- fi
86- echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
87- echo "Building version: $VERSION"
33+ run : sudo apt-get update && sudo apt-get install -y upx
8834
8935 - name : Build package
90- run : |
91- bash build-pkgs.sh --venv
92-
93- - name : List built packages
94- run : |
95- echo "Built packages:"
96- ls -lh pkg/
97-
98- - name : Extract package name
99- id : pkg_name
100- shell : bash
101- run : |
102- # Find tar.gz or zip file (using find to avoid glob expansion issues)
103- PKG_FILE=$(find pkg -maxdepth 1 -type f \( -name "*.tar.gz" -o -name "*.zip" \) | head -1)
104- if [ -z "$PKG_FILE" ]; then
105- echo "ERROR: No package file found"
106- exit 1
107- fi
108- # Get basename and remove extensions using parameter expansion (portable)
109- PKG_BASE=$(basename "$PKG_FILE")
110- PKG_NAME="${PKG_BASE%.tar.gz}"
111- PKG_NAME="${PKG_NAME%.zip}"
112- echo "PACKAGE_NAME=$PKG_NAME" >> $GITHUB_OUTPUT
113- echo "Package name: $PKG_NAME"
36+ run : bash build-pkgs.sh --venv
11437
115- - name : Upload artifacts
116- uses : actions/upload-artifact@v4
38+ - uses : actions/upload-artifact@v4
11739 with :
118- name : ${{ steps.pkg_name.outputs.PACKAGE_NAME }}
119- path : |
120- pkg/*.tar.gz
121- pkg/*.zip
122- retention-days : 30
40+ name : ${{ matrix.os }}-package
41+ path : pkg/*
12342 if-no-files-found : error
124-
125- summary :
126- name : Build Summary
127- needs : build-artifacts
128- runs-on : ubuntu-latest
129- steps :
130- - name : Generate summary
131- run : |
132- echo "## Release Build Complete" >> $GITHUB_STEP_SUMMARY
133- echo "" >> $GITHUB_STEP_SUMMARY
134- echo "Binary packages have been built for the following platforms:" >> $GITHUB_STEP_SUMMARY
135- echo "" >> $GITHUB_STEP_SUMMARY
136- echo "- Linux x86_64" >> $GITHUB_STEP_SUMMARY
137- echo "- Linux ARM64" >> $GITHUB_STEP_SUMMARY
138- echo "- macOS Intel x86_64" >> $GITHUB_STEP_SUMMARY
139- echo "- macOS Apple Silicon ARM64" >> $GITHUB_STEP_SUMMARY
140- echo "- Windows x86_64" >> $GITHUB_STEP_SUMMARY
141- echo "- Windows ARM64" >> $GITHUB_STEP_SUMMARY
142- echo "" >> $GITHUB_STEP_SUMMARY
143- echo "### Next Steps:" >> $GITHUB_STEP_SUMMARY
144- echo "" >> $GITHUB_STEP_SUMMARY
145- echo "1. Download artifacts from the workflow run (6 packages total)" >> $GITHUB_STEP_SUMMARY
146- echo "2. GPG sign each package (.tar.gz/.zip files)" >> $GITHUB_STEP_SUMMARY
147- echo "3. Build FreeBSD package manually (not available on GitHub runners)" >> $GITHUB_STEP_SUMMARY
148- echo "4. Create GitHub release and upload all signed packages" >> $GITHUB_STEP_SUMMARY
149- echo "" >> $GITHUB_STEP_SUMMARY
150- echo "### Manual Build Required:" >> $GITHUB_STEP_SUMMARY
151- echo "FreeBSD packages must still be built manually (GitHub does not provide FreeBSD runners)" >> $GITHUB_STEP_SUMMARY
0 commit comments