-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (63 loc) · 2.07 KB
/
release.yml
File metadata and controls
76 lines (63 loc) · 2.07 KB
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
##
## Copyright (c) 2022-2023 Geosiris.
## SPDX-License-Identifier: Apache-2.0
##
name: Build-and-Push
on:
push:
tags:
# Run when a tag is pushed with a valid semantic version number
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
GENERATED_CODE_FOLDER: etptypes
PYTHON_VERSION: 3.9
jobs:
build:
name: Building generated code
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: Generate code from avro-to-python-etp
uses: ./.github/actions/generate
with:
python-version: ${{ env.PYTHON_VERSION }}
dest-folder: ${{ env.GENERATED_CODE_FOLDER }}
etp-file-name: ${{ secrets.ETP_FILE_NAME }}
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 💾 Cache Poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-
- name: 📦 Install poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: '2.1.1'
- name: Python Black
run: |
cd ${{ env.GENERATED_CODE_FOLDER }}
poetry add -D black
poetry run black etptypes
- name: 📦 Install poetry-dynamic-versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: 📥 Install dependencies
run: poetry install --no-interaction --no-root
- name: 🛠️ Build the package
run: |
cd ${{ env.GENERATED_CODE_FOLDER }}
rm pyproject.toml
cp ${{ github.workspace }}/pyproject.toml .
cp ${{ github.workspace }}/LICENSE .
cp ${{ github.workspace }}/README.md .
poetry build
- name: 🚀 Publish to PyPI
run: |
cd ${{ env.GENERATED_CODE_FOLDER }}
poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }}
poetry publish