Skip to content

Commit ea37c0a

Browse files
committed
Add release workflows
All files were wholesale copied from `kurtmckee/github-workflows@v2.0`.
1 parent 46de509 commit ea37c0a

59 files changed

Lines changed: 4929 additions & 101 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[{*.json,*.yaml,*.yml}]
12+
indent_size = 2
13+
14+
[{README.rst,docs/*.rst}]
15+
indent_size = unset
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "✨ Prep release"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "The new version"
8+
type: "string"
9+
required: true
10+
11+
jobs:
12+
prep-release:
13+
name: "Prep release v${{ inputs.version }}"
14+
15+
permissions:
16+
contents: "write"
17+
pull-requests: "write"
18+
19+
strategy:
20+
matrix:
21+
include:
22+
- tox-label-create-changes: "prep-release"
23+
branch-name: "release/$VERSION"
24+
commit-title: "Update project metadata"
25+
pr-base: "releases"
26+
pr-title: "Release v$VERSION"
27+
28+
uses: "./.github/workflows/create-pr.yaml"
29+
with:
30+
config: "${{ toJSON(matrix) }}"
31+
version: "${{ inputs.version }}"

.github/workflows/_test.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "🧪 Test"
2+
3+
on:
4+
pull_request:
5+
types:
6+
# These are the default on:pull_request types.
7+
- "opened"
8+
- "reopened"
9+
- "synchronize"
10+
# Release automation opens PRs as drafts without triggering CI;
11+
# clicking "Ready for review" in the UI will trigger test runs.
12+
- "ready_for_review"
13+
push:
14+
branches:
15+
- "main"
16+
- "releases"
17+
18+
jobs:
19+
test:
20+
name: "${{ matrix.name }}"
21+
strategy:
22+
matrix:
23+
include:
24+
- name: "Linux"
25+
runner: "ubuntu-24.04"
26+
cpythons:
27+
- "3.13"
28+
cache-key-hash-files:
29+
- "requirements/*/*.txt"
30+
cache-paths:
31+
- ".mypy_cache/"
32+
tox-skip-environments:
33+
- "coverage-html"
34+
35+
uses: "./.github/workflows/tox.yaml"
36+
with:
37+
config: "${{ toJSON(matrix) }}"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# This file is a part of the Globus GitHub Workflows project.
2+
# https://github.com/globus/workflows
3+
# Copyright 2021-2026 Globus <support@globus.org>
4+
# Copyright 2024-2026 Kurt McKee <contactme@kurtmckee.org>
5+
# SPDX-License-Identifier: MIT
6+
7+
on:
8+
workflow_call:
9+
outputs:
10+
artifact-id:
11+
description: "The artifact ID that can be subsequently downloaded"
12+
value: "${{ jobs.build.outputs.artifact-id }}"
13+
packages-path:
14+
description: "The path to the Python packages"
15+
value: "${{ jobs.build.outputs.packages-path }}"
16+
17+
env:
18+
PYTHON_VERSION: "[[ PYTHON_VERSION ]]"
19+
UV_VERSION: "[[ UV_VERSION ]]"
20+
ARTIFACT_NAME: "build-python-package-${{ github.run_id }}"
21+
PACKAGES_PATH: "./dist"
22+
BUILD_REQUIREMENTS: |
23+
[[ include_requirements("build") | indent(4) ]]
24+
25+
jobs:
26+
#[#-
27+
# Halt execution if an attempt is made to run the template directly.
28+
# This block is enclosed in a Jinja comment and will not be rendered.
29+
halt:
30+
name: "Halt"
31+
runs-on: "ubuntu-slim"
32+
steps:
33+
- name: "Halt"
34+
run: |
35+
echo "::error::⚠️ Do not run the workflow template directly."
36+
exit 1
37+
#]#
38+
build:
39+
#[#-
40+
# The `needs` key is in a Jinja comment and will not be rendered.
41+
needs: ["halt"]
42+
#]#
43+
name: "Build"
44+
runs-on: "ubuntu-24.04"
45+
permissions:
46+
contents: "read"
47+
outputs:
48+
artifact-id: "${{ steps.upload-packages.outputs.artifact-id }}"
49+
packages-path: "${{ steps.packages-path.outputs.packages-path }}"
50+
steps:
51+
- name: "Setup Python"
52+
uses: "actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405" # v6.2.0
53+
with:
54+
python-version: "${{ env.PYTHON_VERSION }}"
55+
56+
- name: "Install uv"
57+
uses: "astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867" # v7.1.6
58+
with:
59+
version: "${{ env.UV_VERSION }}"
60+
enable-cache: "false"
61+
ignore-empty-workdir: "true"
62+
63+
- name: "Checkout the repository"
64+
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
65+
with:
66+
ref: "${{ github.sha }}"
67+
persist-credentials: "false"
68+
69+
- name: "Build the package"
70+
env:
71+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
72+
run: |
73+
REQUIREMENTS_PATH="$(mktemp)"
74+
echo "${BUILD_REQUIREMENTS}" > "${REQUIREMENTS_PATH}"
75+
76+
uv run \
77+
--no-managed-python \
78+
--no-project \
79+
--with-requirements="${REQUIREMENTS_PATH}" \
80+
--module build --installer=uv --outdir="${PACKAGES_PATH}"
81+
82+
- name: "Show checksums"
83+
run: |
84+
sha256sum "${PACKAGES_PATH}"/*
85+
86+
- name: "Upload the built packages"
87+
id: "upload-packages"
88+
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
89+
with:
90+
name: "${{ env.ARTIFACT_NAME }}"
91+
path: "${{ env.PACKAGES_PATH }}"
92+
if-no-files-found: "error"
93+
retention-days: "1"
94+
overwrite: "false"
95+
96+
- name: "Create packages-path output"
97+
id: "packages-path"
98+
run: |
99+
echo "packages-path=${PACKAGES_PATH}" >> "${GITHUB_OUTPUT}"
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# DO NOT EDIT THIS FILE! EDIT 'build-python-package.jinja.yaml'.
2+
3+
# This file is a part of the Globus GitHub Workflows project.
4+
# https://github.com/globus/workflows
5+
# Copyright 2021-2026 Globus <support@globus.org>
6+
# Copyright 2024-2026 Kurt McKee <contactme@kurtmckee.org>
7+
# SPDX-License-Identifier: MIT
8+
9+
on:
10+
workflow_call:
11+
outputs:
12+
artifact-id:
13+
description: "The artifact ID that can be subsequently downloaded"
14+
value: "${{ jobs.build.outputs.artifact-id }}"
15+
packages-path:
16+
description: "The path to the Python packages"
17+
value: "${{ jobs.build.outputs.packages-path }}"
18+
19+
env:
20+
PYTHON_VERSION: "3.13"
21+
UV_VERSION: "0.10.6"
22+
ARTIFACT_NAME: "build-python-package-${{ github.run_id }}"
23+
PACKAGES_PATH: "./dist"
24+
BUILD_REQUIREMENTS: |
25+
build==1.4.0 ; python_version == "3.13"
26+
colorama==0.4.6 ; python_version == "3.13" and os_name == "nt"
27+
packaging==26.0 ; python_version == "3.13"
28+
pyproject-hooks==1.2.0 ; python_version == "3.13"
29+
30+
jobs:
31+
build:
32+
name: "Build"
33+
runs-on: "ubuntu-24.04"
34+
permissions:
35+
contents: "read"
36+
outputs:
37+
artifact-id: "${{ steps.upload-packages.outputs.artifact-id }}"
38+
packages-path: "${{ steps.packages-path.outputs.packages-path }}"
39+
steps:
40+
- name: "Setup Python"
41+
uses: "actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405" # v6.2.0
42+
with:
43+
python-version: "${{ env.PYTHON_VERSION }}"
44+
45+
- name: "Install uv"
46+
uses: "astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867" # v7.1.6
47+
with:
48+
version: "${{ env.UV_VERSION }}"
49+
enable-cache: "false"
50+
ignore-empty-workdir: "true"
51+
52+
- name: "Checkout the repository"
53+
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
54+
with:
55+
ref: "${{ github.sha }}"
56+
persist-credentials: "false"
57+
58+
- name: "Build the package"
59+
env:
60+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
61+
run: |
62+
REQUIREMENTS_PATH="$(mktemp)"
63+
echo "${BUILD_REQUIREMENTS}" > "${REQUIREMENTS_PATH}"
64+
65+
uv run \
66+
--no-managed-python \
67+
--no-project \
68+
--with-requirements="${REQUIREMENTS_PATH}" \
69+
--module build --installer=uv --outdir="${PACKAGES_PATH}"
70+
71+
- name: "Show checksums"
72+
run: |
73+
sha256sum "${PACKAGES_PATH}"/*
74+
75+
- name: "Upload the built packages"
76+
id: "upload-packages"
77+
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
78+
with:
79+
name: "${{ env.ARTIFACT_NAME }}"
80+
path: "${{ env.PACKAGES_PATH }}"
81+
if-no-files-found: "error"
82+
retention-days: "1"
83+
overwrite: "false"
84+
85+
- name: "Create packages-path output"
86+
id: "packages-path"
87+
run: |
88+
echo "packages-path=${PACKAGES_PATH}" >> "${GITHUB_OUTPUT}"

0 commit comments

Comments
 (0)