Skip to content

Release 5.9.5

Release 5.9.5 #9

Workflow file for this run

name: Release
permissions:
contents: write
on:
release:
types: [published]
workflow_dispatch:
inputs:
mode:
description: "Release mode"
type: choice
options:
- do nothing # safe precaution from accident trigger
- force # ignore check of version change in last commit
- dry-run # for testing - no tag, no upload neither to TestPyPI nor to PyPI
default: "do nothing"
push:
branches:
- master
paths:
- "src/PyMca5/__init__.py"
jobs:
version-change:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check-change.outputs.should_release }}
version: ${{ steps.check-change.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 #to have all commits
- name: Get version from file
id: check-change
run: |
version=$(grep -Po '^__version__ = ["'\'']\K[^"'\'']+' src/PyMca5/__init__.py)
echo "Found version: $version"
echo "version=$version" >> $GITHUB_OUTPUT
# Check if the version line was modified in the last commit
changed=$(git diff HEAD^ HEAD -- src/PyMca5/__init__.py | grep '__version__' || true)
if [[ "${{ github.event_name }}" != "workflow_dispatch" && -n "$changed" ]]; then
echo "Version changed"
echo "should_release=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.mode }}" == "force" ]]; then
echo "Release was triggered manually"
echo "should_release=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.mode }}" == "dry-run" ]]; then
echo "Dry-run started"
echo "should_release=true" >> $GITHUB_OUTPUT
else
echo "No release... for now"
echo "should_release=false" >> $GITHUB_OUTPUT
fi
version-check:
needs: version-change
if: needs.version-change.outputs.should_release == 'true'
uses: ./.github/workflows/_Version.yml
with:
skipper: ${{ github.event.inputs.mode }}
run-build-upload:
needs: version-check
uses: ./.github/workflows/_Wheels.yml
trigger-windows-pyinstaller:
needs: run-build-upload
uses: ./.github/workflows/_WindowsExe.yml
trigger-windows-cx:
needs: run-build-upload
uses: ./.github/workflows/_WindowsInstaller.yml
trigger-mac:
needs: run-build-upload
uses: ./.github/workflows/_MacOS.yml
secrets:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD }}
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64 }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APPLICATION_SPECIFIC_PASSWORD }}
tag-release:
if: github.event.inputs.mode != 'dry-run'
permissions:
contents: write
needs:
- trigger-windows-cx
- trigger-mac
uses: ./.github/workflows/_TagRelease.yml
changelog:
if: github.event.inputs.mode != 'dry-run'
permissions:
contents: write
needs: tag-release
uses: ./.github/workflows/_ChangeLog.yml
upload-release:
if: github.event.inputs.mode != 'dry-run'
permissions:
contents: write
needs: tag-release
uses: ./.github/workflows/_UploadRelease.yml
upload-pypi:
needs:
- changelog
- upload-release
uses: ./.github/workflows/_PyPI.yml
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}