Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
release:
environment:
name: release-approval
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
pip install -r requirements.txt
- name: Switch xmipp from devel to release
run: |
sed -i -E "s/^(type_of_version[[:space:]]*=[[:space:]]*)'devel'/\1'release'/" xmipp3/version.py
git add xmipp3/version.py
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git commit -m "Switch xmipp from devel to release"
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build --no-isolation
twine upload dist/* -c "${{ secrets.PYPI_COMMENT }}"
- name: Get changelog, tag name, & release name
id: variables
run:
TAG_NAME=$(grep "_pluginVersion" xmipp3/version.py | sed -E 's/.*"([^"]+)".*/\1/')
RELEASE_NAME="Release ${TAG_NAME}"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Generate tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.variables.outputs.TAG_NAME }}
- name: Create a GitHub release
uses: ncipollo/release-action@main
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.variables.outputs.RELEASE_NAME }}
bodyFile: latest_changelog.md