-
Notifications
You must be signed in to change notification settings - Fork 74
43 lines (40 loc) · 1.11 KB
/
publish.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
name: Build and Publish Release to PYPI
on:
push:
tags:
- v*
jobs:
publish-modelscan:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessary to get tags
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Get Release Version
uses: mtkennerly/dunamai-action@v1
with:
env-var: MODELSCAN_VERSION
args: --style semver --format "{base}"
- name: Set Package Version
run: |
echo "__version__ = '$MODELSCAN_VERSION'" > modelscan/_version.py
poetry version $MODELSCAN_VERSION
- name: Build Package
run: |
poetry build
- name: Publish Package to PYPI
run: |
poetry config pypi-token.pypi ${{ secrets.MODELSCAN_PYPI_API_TOKEN }}
poetry publish