Skip to content

Commit f44fb36

Browse files
committed
refactor(ci): migrate to split workflow architecture
- Use rust-test.yml, rust-build.yml, and rust-release.yml from homebrew-packages - Add target_preset dropdown for easy platform selection (all, windows, linux, macos, mobile, musl) - Separate test/build/release phases for better control - Simplify workflow from hardcoded inputs to preset-based configuration Benefits: - Can rebuild specific platforms via workflow_dispatch - Cleaner separation between CI phases - Better visibility into each phase (test/build/release)
1 parent 061897c commit f44fb36

1 file changed

Lines changed: 42 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ on:
88
workflow_dispatch:
99
inputs:
1010
ref:
11-
description: 'Git ref (branch, tag, or SHA) to build (leave empty for main branch)'
11+
description: 'Git ref (branch, tag, or SHA) to build'
1212
required: false
1313
type: string
1414
default: ''
15-
targets:
16-
description: 'JSON array of targets to build (leave empty for all default targets)'
15+
target_preset:
16+
description: 'Target preset to build'
1717
required: false
18-
type: string
19-
default: ''
20-
force_release:
21-
description: 'Force a release even without a tag'
18+
type: choice
19+
options:
20+
- all
21+
- windows
22+
- linux
23+
- macos
24+
- mobile
25+
- musl
26+
default: 'all'
27+
skip_tests:
28+
description: 'Skip tests'
2229
required: false
2330
type: boolean
2431
default: false
@@ -27,13 +34,35 @@ permissions:
2734
contents: write
2835

2936
jobs:
30-
ci:
31-
uses: CaddyGlow/homebrew-packages/.github/workflows/rust-ci.yml@main
37+
test:
38+
if: ${{ !inputs.skip_tests && github.event_name != 'push' || github.ref_type != 'tag' }}
39+
uses: CaddyGlow/homebrew-packages/.github/workflows/rust-test.yml@main
3240
with:
33-
binaries: '["quickctx", "quickctx-analyze"]'
34-
assets: '["README.md"]'
41+
ref: ${{ inputs.ref || '' }}
3542
test_command: 'cargo test --all-features'
3643
clippy_args: '--all-targets --all-features'
44+
45+
build:
46+
needs: [test]
47+
if: |
48+
always() &&
49+
!cancelled() &&
50+
(needs.test.result == 'success' || needs.test.result == 'skipped') &&
51+
(startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch')
52+
uses: CaddyGlow/homebrew-packages/.github/workflows/rust-build.yml@main
53+
with:
54+
ref: ${{ inputs.ref || '' }}
55+
binaries: '["quickctx", "quickctx-analyze"]'
56+
assets: '["README.md"]'
57+
target_preset: ${{ inputs.target_preset || 'all' }}
58+
59+
release:
60+
needs: [build]
61+
if: |
62+
always() &&
63+
!cancelled() &&
64+
needs.build.result == 'success' &&
65+
startsWith(github.ref, 'refs/tags/')
66+
uses: CaddyGlow/homebrew-packages/.github/workflows/rust-release.yml@main
67+
with:
3768
ref: ${{ inputs.ref || '' }}
38-
targets: ${{ inputs.targets || '' }}
39-
force_release: ${{ inputs.force_release || false }}

0 commit comments

Comments
 (0)