-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (37 loc) · 1.24 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
44
45
46
47
name: 'PyPI publish'
on:
release:
types: [published]
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
if: github.event.release.target_commitish == 'main'
environment:
name: pypi
url: https://pypi.org/p/clusopt_core
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
- name: Bump version
run: |
NEW_VERSION=${{ github.event.release.tag_name }}
sed -i "s/version = .*/version = \"$NEW_VERSION\"/" setup.py
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: update pip
run: python -m pip install --upgrade pip
- name: install build
run: pip install build==1.2.1
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build
run: python -m build --sdist .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1