Merge #525 from hakonanes/use-numpy-exceptions #13
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 | |
# orix/__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: | |
- "orix/__init__.py" | |
jobs: | |
make-tagged-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Set up Python ${{ runner.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install packaging 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: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
tag_name: v${{ env.BRANCH_VERSION }} | |
release_name: orix ${{ env.BRANCH_VERSION }} | |
commitish: main | |
body_path: release_part_in_changelog.md | |
prerelease: false |