Merge pull request #203 from Dewberry/release/0.6.0 #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |