-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (57 loc) · 1.83 KB
/
build-python.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
name: build-python
on:
workflow_call:
inputs:
branch:
type: string
required: false
default: ${{ github.ref || github.head_ref }}
runs_on:
type: string
required: false
default: "ubuntu-22.04"
secrets:
DATAVISYN_BOT_REPO_TOKEN:
required: false
PYTHON_VERSION:
required: false
env:
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
PYPI_USERNAME: "test"
PYTHON_VERSION: "3.10"
WORKFLOW_BRANCH: "main"
permissions:
contents: read
id-token: write
concurrency:
group: '${{ github.workflow }}-${{ github.ref || github.head_ref }}'
cancel-in-progress: true
jobs:
build-python:
concurrency:
group: "python-${{ github.workflow }}-${{ github.ref || github.head_ref }}-${{ inputs.branch }}"
cancel-in-progress: true
permissions:
id-token: write
contents: write
runs-on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- name: Checkout github-workflows
uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
path: ./tmp/github-workflows
- name: Build python
uses: ./tmp/github-workflows/.github/actions/build-node-python
with:
enable_node: false
enable_python: true
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
enable_python_cache: ${{ inputs.runs_on != 'self-hosted' }}