Skip to content

Commit 776b078

Browse files
committed
ci: update the bundle artifact version before building, and standardize version string pattern
1 parent 218e4b6 commit 776b078

File tree

2 files changed

+23
-48
lines changed

2 files changed

+23
-48
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
version:
7+
description: "Version to build (x.x.x)"
78
type: string
89
required: false
910
default: ''
@@ -50,7 +51,7 @@ jobs:
5051
run: uv run basedpyright
5152

5253
test:
53-
name: Test
54+
name: Unit Tests
5455
runs-on: ubuntu-latest
5556
steps:
5657
- name: Checkout code
@@ -70,14 +71,13 @@ jobs:
7071
- name: Install dependencies
7172
shell: bash
7273
run: uv sync --group dev
73-
7474

7575
- name: Run tests
7676
run: uv run pytest tests/ -v
7777

7878
python-package:
7979
name: Python Package
80-
needs:
80+
needs:
8181
- lint
8282
- test
8383
runs-on: ubuntu-latest
@@ -99,6 +99,11 @@ jobs:
9999
version: latest
100100
enable-cache: true
101101

102+
- name: Update version
103+
shell: bash
104+
if: inputs.version != ''
105+
run: uv version ${inputs.version}
106+
102107
- name: Build wheel
103108
shell: bash
104109
run: |
@@ -120,7 +125,7 @@ jobs:
120125

121126
build-binaries:
122127
name: ${{ matrix.platform }} Binary
123-
needs:
128+
needs:
124129
- lint
125130
- test
126131
runs-on: ${{ matrix.runner }}
@@ -152,27 +157,32 @@ jobs:
152157
version: latest
153158
enable-cache: true
154159

160+
- name: Update version
161+
shell: bash
162+
if: inputs.version != ''
163+
run: uv version ${inputs.version}
164+
155165
- name: Install dependencies
156166
shell: bash
157-
run: uv sync
167+
run: uv sync --group build
158168

159169
- name: Build binary
160170
shell: bash
161171
run: |
162-
uv run pyinstaller src/lumos_cli/__main__.py
172+
uv run pyinstaller src/lumos/__main__.py
163173
if [[ "${{ matrix.platform }}" == "windows" ]]; then
164174
mv ./dist/__main__/__main__.exe ./dist/__main__/lumos.exe
165175
else
166176
mv ./dist/__main__/__main__ ./dist/__main__/lumos
167177
fi
168178
VERSION="${{ inputs.version || 'dev' }}"
169-
tar -czf lumos-${{ matrix.platform }}-${VERSION}.tar.gz -C ./dist/__main__ .
179+
tar -czf lumos-${{ matrix.platform }}-v${VERSION}.tar.gz -C ./dist/__main__ .
170180

171181
- name: Upload artifacts to workflow
172182
uses: actions/upload-artifact@v4
173183
with:
174-
name: lumos-${{ matrix.platform }}-${{ inputs.version || 'dev' }}
175-
path: lumos-${{ matrix.platform }}-${{ inputs.version || 'dev' }}.tar.gz
184+
name: lumos-${{ matrix.platform }}-v${{ inputs.version || 'dev' }}
185+
path: lumos-${{ matrix.platform }}-v${{ inputs.version || 'dev' }}.tar.gz
176186
retention-days: 90
177187

178188
test-binaries:
@@ -196,19 +206,19 @@ jobs:
196206
- name: Download binary artifact
197207
uses: actions/download-artifact@v4
198208
with:
199-
name: lumos-${{ matrix.platform }}-${{ inputs.version || 'dev' }}
209+
name: lumos-${{ matrix.platform }}-v${{ inputs.version || 'dev' }}
200210

201211
- name: Extract and test binary (Unix)
202212
if: matrix.platform != 'windows'
203213
shell: bash
204214
run: |
205-
tar -xzf lumos-${{ matrix.platform }}-${{ inputs.version || 'dev' }}.tar.gz
215+
tar -xzf lumos-${{ matrix.platform }}-v${{ inputs.version || 'dev' }}.tar.gz
206216
chmod +x lumos
207217
./lumos --version
208218

209219
- name: Extract and test binary (Windows)
210220
if: matrix.platform == 'windows'
211221
shell: pwsh
212222
run: |
213-
tar -xzf lumos-${{ matrix.platform }}-${{ inputs.version || 'dev' }}.tar.gz
223+
tar -xzf lumos-${{ matrix.platform }}-v${{ inputs.version || 'dev' }}.tar.gz
214224
.\lumos.exe --version

.github/workflows/release.yml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,44 +52,9 @@ jobs:
5252
if: needs.prepare.outputs.new-release-version != ''
5353
uses: ./.github/workflows/build.yml
5454
with:
55-
version: v${{ needs.prepare.outputs.new-release-version }}
55+
version: ${{ needs.prepare.outputs.new-release-version }}
5656
secrets: inherit
5757

58-
publish-wheel:
59-
name: Save Python Wheel Artifacts
60-
needs: [prepare, build]
61-
if: needs.prepare.outputs.new-release-version != ''
62-
runs-on: ubuntu-latest
63-
permissions:
64-
contents: read
65-
packages: write
66-
steps:
67-
- name: Checkout code
68-
uses: actions/checkout@v4
69-
70-
- name: Download wheel artifact
71-
uses: actions/download-artifact@v4
72-
with:
73-
name: python-wheel
74-
path: dist/
75-
76-
- name: Download sdist artifact
77-
uses: actions/download-artifact@v4
78-
with:
79-
name: python-sdist
80-
path: dist/
81-
82-
- name: List artifacts
83-
run: |
84-
echo "Python distribution artifacts:"
85-
ls -lh dist/
86-
87-
- name: Upload Python distributions as release artifacts
88-
uses: actions/upload-artifact@v4
89-
with:
90-
name: python-distributions-v${{ needs.prepare.outputs.new-release-version }}
91-
path: dist/*
92-
retention-days: 90
9358

9459
release:
9560
name: Create Release

0 commit comments

Comments
 (0)