-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (100 loc) · 2.51 KB
/
package-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
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
109
110
111
112
113
114
name: Relenv Python Package
on:
workflow_call:
inputs:
kind:
required: false
type: string
default: dev
cmd:
required: false
type: string
description: Command used to build python package
default: >-
python -m
build
-C--global-option=egg_info
-C--global-option=--tag-build=dev$(git rev-parse --short HEAD)
--wheel
--outdir dist/
outputs:
version:
value: "${{ jobs.build.outputs.version }}"
jobs:
build-source:
name: Build Python Wheel
runs-on: ubuntu-latest
steps:
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build Source Tarball
run: |
python3 -m build -s
- name: Python Build Artifact
uses: actions/upload-artifact@v4
with:
name: Source Tarball
path: dist/*
retention-days: 5
build:
name: Build Python Wheel
strategy:
matrix:
host:
- x86_64
- aarch64
runs-on:
- self-hosted
- linux
- src-build
- ${{ matrix.host }}
container:
image: debian:11
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@master
- name: Update Apt
run: >-
apt-get update
- name: Install OS Dependencies
run: >-
apt-get install -y gcc python3
python3-pip python3-venv flex make
texinfo unzip help2man gawk libtool-bin libncurses5-dev
bison wget rsync git
- name: Create virtualenv
run: >-
python3 -m venv venv
- name: Activate virtualenv
run: |
. venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Python Version
run: >-
python3 --version
- name: Install Python Dependencies
run: >-
pip install build wheel setuptools pkginfo
- name: Echo Build Wheel Command
run: echo "${{ inputs.cmd }}"
- name: Build Wheel
run: |
${{ inputs.cmd }}
- name: Python Build Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: Python Wheel ${{ matrix.host }}
path: dist/*.whl
retention-days: 5
- name: Read Version
run: >-
python3
-c
"from pkginfo import Wheel; s = Wheel('''$(ls dist/*.whl)'''); print('version='+str(s.version))"
>>
$GITHUB_OUTPUT
id: version