-
-
Notifications
You must be signed in to change notification settings - Fork 14
52 lines (43 loc) · 1.35 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
name: Release
on:
push:
tags:
- 'v*'
jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set Up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Upgrade Dependencies
run: |
python -m pip install --upgrade build
python -m pip install --upgrade pip
- name: Build Project for Distribution
run: python -m build
- name: Check Version
id: check-version
run: |
pip install -e .
[[ "$(python -c "import openskill; print(openskill.__version__)")" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo "prerelease=true" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'
generateReleaseNotes: true
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}