Release #20
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: | |
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 }} | |
environment: pypi.org | |
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 | |
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 }} |