Release dcaspt2_input_generator 0.7.0 #64
Workflow file for this run
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: dcaspt2_input_generator-publish | |
on: | |
pull_request: | |
types: [closed] | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
# If PR is merged and the branch name starts with "release-v", then publish to PyPI | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python 3.13 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install hatch twine | |
- name: Build package | |
run: | | |
hatch build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Get the tag name | |
id: get_tag_name | |
run: | | |
echo "tag_name=$(echo "${{ github.head_ref }}" | sed -e 's/release-//')" >> $GITHUB_OUTPUT | |
- name: Create tag | |
run: | | |
git tag ${{ steps.get_tag_name.outputs.tag_name }} | |
git push origin ${{ steps.get_tag_name.outputs.tag_name }} | |
- name: Create release draft | |
uses: release-drafter/release-drafter@v6 | |
with: | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |