Skip to content

v0.3.3

v0.3.3 #20

Workflow file for this run

name: release
on:
push:
tags:
- '*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # need tags to generate release notes
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install package
run: |
poetry install
- name: Run ruff
run: |
poetry run ruff radiacode radiacode-examples
poetry run ruff format --check radiacode radiacode-examples
- name: Build wheel
id: build
run: |
poetry build
echo ::set-output name=wheel_name::radiacode-${GITHUB_REF#refs/tags/}-py3-none-any.whl
- name: Generate Release Notes
run: |
echo '## Changes since previous release:' > changelog.md
git log --oneline $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- [%h](https://github.com/cdump/radiacode/commit/%H) %s" >> changelog.md
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body_path: changelog.md
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: ${{ steps.build.outputs.wheel_name }}
asset_path: dist/${{ steps.build.outputs.wheel_name }}
asset_content_type: application/x-wheel+zip
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish