-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (62 loc) · 2.05 KB
/
build-python.yml
File metadata and controls
67 lines (62 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build Python Packages
on:
push:
pull_request:
workflow_dispatch:
inputs:
release_date:
description: >
Release tag (YYYYMMDD). When set, a single GitHub release with that
tag is created and all per-platform tarballs from every matrix entry
are published as assets. Leave empty for a build-only run that uploads
per-job artifacts but does not publish a release.
required: false
type: string
default: ""
# Cancel in-flight runs when a newer event arrives for the same logical branch.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
build-matrix:
name: Build Python ${{ matrix.python_version }}
strategy:
fail-fast: false
matrix:
python_version:
- 3.12.13
- 3.13.14
- 3.14.6
uses: ./.github/workflows/build-python-version.yml
with:
python_version: ${{ matrix.python_version }}
secrets: inherit
publish-release:
name: Publish Release Assets
runs-on: ubuntu-latest
# Date-keyed releases (PBS-style): only publish when an operator explicitly
# triggers via workflow_dispatch with a `release_date` input. Pushes still
# exercise the matrix but leave per-job artifacts for inspection and do
# not touch GitHub releases.
if: github.event_name == 'workflow_dispatch' && inputs.release_date != ''
needs:
- build-matrix
permissions:
contents: write
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v8
with:
pattern: python-*
path: release-artifacts
merge-multiple: true
- name: Publish all artifacts to release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ inputs.release_date }}
name: ${{ inputs.release_date }}
files: release-artifacts/*
fail_on_unmatched_files: true
generate_release_notes: false
draft: false
prerelease: false