forked from re-actors/checkout-python-sdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
67 lines (62 loc) · 1.93 KB
/
action.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
---
name: checkout-python-sdist
description: >-
GitHub Action for unpacking the source out of
a source Python package distribution tarball
author: >-
Sviatoslav Sydorenko
<wk+~github.com/re-actors/checkout-python-sdist@sydorenko.org.ua>
branding:
icon: git-pull-request
color: blue
inputs:
source-tarball-name:
default: >-
*.tar.gz
description: >-
A glob for the source distribution tarball filename
in the artifact (defaults to `*.tar.gz`)
required: false
workflow-artifact-name:
default: python-package-distributions
description: >-
Used to extract the source distribution tarball from
(defaults to `python-package-distributions`)
required: false
runs:
using: composite
steps:
- name: Error out on empty workflow artifact input
if: >-
!inputs.workflow-artifact-name
run: exit 1
shell: bash
- name: Error out on empty tarball input
if: >-
!inputs.source-tarball-name
run: exit 1
shell: bash
- name: Retrieve the dists from a GHA artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.workflow-artifact-name }}
path: ${{ github.action_path }}/.tmp
- name: >-
Get a *NIX-style workspace directory absolute path
# NOTE: This is necessary because attempting to use ${{ github.workspace }}
# NOTE: in the `tar` command makes it error out under Windows workers. This
# NOTE: is supposedly happening because `shell: bash` uses Git Bash (v4)
# NOTE: and not MINGW Bash (v5) which does not have this problem.
id: workdir
run: >-
echo path="$(pwd)" >> "${GITHUB_OUTPUT}"
working-directory: ${{ github.workspace }}
shell: bash
- name: Get the source out of the tarball
run: >-
tar xzvf ${{ inputs.source-tarball-name }}
--directory='${{ steps.workdir.outputs.path }}'
--strip-components=1
working-directory: ${{ github.action_path }}/.tmp
shell: bash
...