-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (38 loc) · 985 Bytes
/
release.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
name: Release
on:
push:
tags: ["*"]
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/torch-pme
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install tox
- name: Build package
run: tox -e build
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to GitHub release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
dist/*.whl
prerelease: ${{ contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}