Skip to content

Release

Release #12

Workflow file for this run

name: Release
on:
schedule:
- cron: '0 0 28 * *' # Monthly auto-release
workflow_dispatch: # Manual trigger for quick fixes
jobs:
inputs:
runs-on: ubuntu-latest
outputs:
force_arg: ${{ steps.init.outputs.force_arg }}
steps:
- id: init
name: Analyze input arguments
run: |
if [ "${{ secrets.RELEASE_TYPE }}" != "Auto"]; then
echo "force_arg=${{ secrets.RELEASE_TYPE }}" >> ${GITHUB_OUTPUT}
else
echo "force_arg=" >> ${GITHUB_OUTPUT}
fi
release:
if: github.repository == 'crabisoft/pdbstore'
needs: inputs
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
environment: pypi.org
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}
steps:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v8.1.1
with:
github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
force: ${{ needs.inputs.outputs.force_arg }}
- uses: actions/upload-artifact@v3
if: steps.release.outputs.released == 'true'
with:
name: linux-build
path: ./installer/dist/*.tar.gz
- uses: actions/upload-artifact@v3
if: steps.release.outputs.released == 'true'
with:
name: python-build
path: ./dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
with:
skip-existing: true
verbose: true
- name: Build and publish to Conda-forge
uses: crabisoft/publish-conda@v1.0.0
if: steps.release.outputs.released == 'true'
with:
sub-directory: 'conda'
platforms: 'noarch'
token: ${{ secrets.ANACONDA_TOKEN }}
windows-build:
needs: [release]
runs-on: windows-latest
concurrency: windows-build
if: github.repository == 'crabisoft/pdbstore' && needs.release.outputs.released == 'true'
steps:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- name: Set up Python 3.11
uses: actions/setup-python@v4.7.0
with:
python-version: 3.11
- name: Build Windows executable
run: |
python -m pip install -r requirements.txt
python installer/build.py
- uses: actions/upload-artifact@v3
with:
name: windows-build
path: ./installer/dist/*.zip
release-notes:
if: github.repository == 'crabisoft/pdbstore' && needs.release.outputs.released == 'true'
needs: [release, windows-build]
runs-on: ubuntu-latest
concurrency: publish
steps:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: linux-build
path: installer/dist
- uses: actions/download-artifact@v3
with:
name: python-build
path: dist
- uses: actions/download-artifact@v3
with:
name: windows-build
path: installer/dist
- name: Publish package to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.tag }}