-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.02 KB
/
cd-sdist.yml
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
name: cd-sdist
permissions:
contents: read
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
repository:
description: 'mpi4py repository'
default: mpi4py/mpi4py
required: false
type: string
ref:
description: 'mpi4py ref'
default: ''
required: false
type: string
workflow_dispatch:
inputs:
repository:
description: 'mpi4py repository'
default: mpi4py/mpi4py
required: true
type: string
ref:
description: 'mpi4py ref'
default: ''
required: false
type: string
jobs:
sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
ref: ${{ inputs.ref }}
- name: Set SOURCE_DATE_EPOCH
run: |
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
echo SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH >> $GITHUB_ENV
echo $(git log -1 --pretty=%ci) [timestamp=$SOURCE_DATE_EPOCH]
shell: bash
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3
- name: Upgrade pip
run: python -m pip install -U pip
- name: Install build and twine
run: python -m pip install -U build twine
- name: Build source distribution
run: python -m build --sdist
- name: Check source distribution
run: python -m twine check dist/*.tar.gz
- id: upload
name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
- id: report
run: |
# report
artifact='Artifact: <${{ steps.upload.outputs.artifact-url }}>'
echo $artifact >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
sha256sum -b *.tar.gz >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
shell: bash
working-directory: dist