-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (43 loc) · 1.46 KB
/
pypi-publish.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
name: Publish Python Package
on:
release:
types: [created]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
# this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Poetry
run: |
pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install project dependencies
run: poetry install --no-interaction
- name: Install yq
env:
YQ_VERSION: v4.30.5
YQ_BINARY: yq_linux_amd64
run: |
mkdir -p $HOME/.local/bin
wget https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/$YQ_BINARY.tar.gz -O - | tar xz && mv $YQ_BINARY $HOME/.local/bin/yq
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generate project files
run: |
make clean schema-clean src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml ingest-triad
poetry dynamic-versioning
make gen-project
make project/json/nmdc_submission_schema.json
cp -r project src/nmdc_submission_schema
- name: Build source and wheel archives
run: poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1