-
-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (95 loc) · 2.8 KB
/
Copy pathbuild.yaml
File metadata and controls
108 lines (95 loc) · 2.8 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: "Build Package"
on:
workflow_call:
inputs: &inputs
version:
description: "Build Version"
type: string
required: true
#version-file:
# description: "Version File"
# type: string
# default: "src/*/_version.py"
name:
description: "Artifact Name"
type: string
default: "dist"
path:
description: "Build Path"
type: string
default: "dist"
workflow_dispatch:
inputs: *inputs
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v6
- name: "Debug event.json"
continue-on-error: true
run: cat "${GITHUB_EVENT_PATH}"
- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"
- name: "Debug Environment"
continue-on-error: true
run: env
- name: "Setup Python 3.13"
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"
- name: "Install"
run: |
python -m pip install -U pip
python -m pip install --group dev
#- name: "Update Version"
# if: ${{ inputs.version-file }}
# uses: justalemon/VersionPatcher@master
# with:
# version: ${{ inputs.version }}
# initpy-files: ${{ inputs.version-file }}
#
#- name: "Debug Version"
# if: ${{ inputs.version-file }}
# continue-on-error: true
# run: |
# cat ${{ inputs.version-file }}
- name: "Build"
run: |
python -m build
- name: "List Artifacts"
continue-on-error: true
working-directory: ${{ inputs.path }}
run: |
results="$(tree .)"
echo "::group::results"
echo "${results}"
echo "::endgroup::"
md="Artifacts: \`${{ inputs.path }}\`\n\`\`\`text\n${results}\n\`\`\`"
echo -e "${md}" >> "$GITHUB_STEP_SUMMARY"
- name: "Upload to Actions"
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- name: "Upload Release"
if: ${{ github.event_name == 'release' }}
uses: cssnr/upload-release-action@latest
with:
globs: |
dist/*.whl
dist/*.tar.gz
- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}