Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Release update

Release update #11528

name: Release update
on:
schedule:
- cron: "42 * * * *"
workflow_dispatch:
jobs:
release_update:
name: Update latest.tag for new pyMOR release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
path: docs
- name: install dependencies
run: python3 -m pip install jinja2
- uses: actions/checkout@v2
with:
repository: pymor/pymor
fetch-depth: 0
path: pymor
- name: get new tag
run: |
cd $GITHUB_WORKSPACE/pymor
NEW_TAG=$(git tag -l | grep 202 | sed -e '/rc/d' | sort -r | head -n1)
echo "new_tag=${NEW_TAG}" >> $GITHUB_ENV
- name: update docs
run: |
cd $GITHUB_WORKSPACE/docs
TAG_FILE=$GITHUB_WORKSPACE/docs/latest.tag
export OLD_TAG=$(cat ${TAG_FILE})
export NEW_TAG=${{ env.new_tag }}
export NEW_DIR=$(echo ${{ env.new_tag }} | sed -e 's/\./-/g' )
export OLD_DIR=$(echo ${OLD_TAG} | sed -e 's/\./-/g' )
echo ${{ env.new_tag }} > ${TAG_FILE}
git rm -qrf latest
cp -ra ${NEW_DIR} latest
sed -i "s;${OLD_DIR};${NEW_DIR};g" index.html
python3 update_versions.py
python3 makeindex.py
- name: get tag username
run: |
cd $GITHUB_WORKSPACE/pymor
export TAG_AUTHOR=$(git for-each-ref refs/tags/${{ env.new_tag }} --format="%(taggername)")
gh api \
-H "Accept: application/vnd.github+json" \
/search/users?q=$(echo ${TAG_AUTHOR}| jq -sRr @uri) > /tmp/gh.json
export TAG_AUTHOR=$(cat /tmp/gh.json | jq -r '.items[0].login')
echo "tag_author=${TAG_AUTHOR}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/[email protected]
name: Create a PR for new pyMOR release
with:
commit-message: "[Bot] Update latest pyMOR"
title: "[Bot] Update latest pyMOR"
assignees: ${{ env.tag_author}}
path: docs
author: pyMOR-Bot <[email protected]>
delete-branch: true
branch: update-latest-pymor
labels: "automerge"