-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.16 KB
/
release.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
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
name: release
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Print Python version
run: python --version
- name: Install release dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine toml
- name: Verify toml installation
run: python -c "import toml; print('toml module is installed')"
- name: Extract version from pyproject.toml
id: get_version
shell: pwsh
run: |
$version = python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])"
echo "::set-output name=VERSION::$version"
- name: Build wheel and source distribution
run: python -m build
- name: List dist directory contents
run: dir dist
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
release_name: Release v${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
- name: List dist directory contents again
run: dir dist
- name: Upload Source Distribution
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/ripple1d-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_name: ripple1d-v${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_content_type: application/gzip