This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (63 loc) · 2.11 KB
/
u24_element_build.yaml
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
name: u24_element_build
on:
workflow_call:
inputs:
py_ver:
required: true
type: string
image:
required: true
type: string
jobs:
test-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout element repo
uses: actions/checkout@v3
- name: Get changelog entry
id: changelog_reader
uses: guzman-raphael/changelog-reader-action@v5
with:
path: ./CHANGELOG.md
- name: Verify changelog parsing
env:
TAG_NAME: ${{steps.changelog_reader.outputs.version}}
RELEASE_NAME: Release ${{steps.changelog_reader.outputs.version}}
BODY: ${{steps.changelog_reader.outputs.changes}}
PRERELEASE: ${{steps.changelog_reader.outputs.status == 'prereleased'}}
DRAFT: ${{steps.changelog_reader.outputs.status == 'unreleased'}}
run: |
echo "TAG_NAME=${TAG_NAME}"
echo "RELEASE_NAME=${RELEASE_NAME}"
echo "BODY=${BODY}"
echo "PRERELEASE=${PRERELEASE}"
echo "DRAFT=${DRAFT}"
build:
needs: test-changelog
runs-on: ubuntu-latest
env:
PY_VER: ${{inputs.py_ver}}
IMAGE: ${{inputs.image}}
DOCKER_CLIENT_TIMEOUT: "120"
COMPOSE_HTTP_TIMEOUT: "120"
steps:
- name: Checkout element repo
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{env.PY_VER}}
- name: Compile image
run: |
export PKG_NAME=$(python3 -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])")
export PKG_VERSION=$(cat ${PKG_NAME}/version.py | grep -oP '\d+\.\d+\.[a-z0-9]+')
export HOST_UID=$(id -u)
pip install wheel && python setup.py bdist_wheel sdist
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_ENV
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_ENV
- if: ${{ env.PY_VER }} == '3.9'
name: Add pip artifacts
uses: actions/upload-artifact@v2
with:
name: pip-${{env.PKG_NAME}}-${{env.PKG_VERSION}}
path: dist
retention-days: 1