Merge pull request #700 from hakonanes/690-oxford-ebsp-aztec-6.1 #26
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: Perhaps make a tagged release | |
# Trigger workflow when commits to the main branch contain a change in | |
# the kikuchipy/__init__.py file. This is because this workflow should | |
# only run when a tagged release draft is to be made. | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "src/kikuchipy/__init__.py" | |
jobs: | |
make-tagged-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Set up Python ${{ runner.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install outdated | |
- name: Check whether a tagged release draft should be made | |
run: | | |
cd .github/workflows | |
eval x=($(python perhaps_make_tagged_release_draft.py)) | |
echo "MAKE_RELEASE=${x[0]}" >> $GITHUB_ENV | |
echo "PYPI_VERSION=${x[1]}" >> $GITHUB_ENV | |
echo "BRANCH_VERSION=${x[2]}" >> $GITHUB_ENV | |
- name: Make tagged release draft body from changelog | |
if: ${{ env.MAKE_RELEASE == 'true' }} | |
run: | | |
pandoc .github/workflows/release_part_in_changelog.rst -f rst -t markdown -o release_part_in_changelog.md --wrap=none | |
- name: Make tagged release draft | |
if: ${{ env.MAKE_RELEASE == 'true' }} | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body_path: release_part_in_changelog.md | |
draft: true | |
prerelease: false | |
name: kikuchipy ${{ env.BRANCH_VERSION }} | |
tag_name: v${{ env.BRANCH_VERSION }} | |
target_commitish: main |