Skip to content

Bump certifi from 2023.5.7 to 2023.7.22 #54

Bump certifi from 2023.5.7 to 2023.7.22

Bump certifi from 2023.5.7 to 2023.7.22 #54

Workflow file for this run

---
name: Bump version
on:
pull_request_target:
types: [closed]
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Update changelog
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
commitish: ${{ github.event.pull_request.base.ref }}
env:
GITHUB_TOKEN: ${{ secrets.BP_PAT_TOKEN }}
- name: Get previous release version
run: |
echo "PREV_VER=$(cat pyproject.toml | grep -o -E '(version\s=\s)([[:punct:]])([0-9]+\.[0-9]+\.[0-9]+.+)([[:punct:]])' | cut -d ' ' -f 3 | tr -d '"')" >> $GITHUB_ENV
- name: Get previous bump version
env:
PREV_VER: ${{ env.PREV_VER }}
run: |
if [[ "$PREV_VER" != *"-pre."* ]]; then
echo "OLD_BUMP=0" >> $GITHUB_ENV
else
echo "OLD_BUMP=$(echo $PREV_VER | cut -d '.' -f 4)" >> $GITHUB_ENV
fi
- name: Bump version
env:
BUMP_VER: ${{ env.OLD_BUMP }}
run: |
echo "NEW_BUMP=$(($BUMP_VER + 1))" >> $GITHUB_ENV
- name: Set new release version
env:
RD_RELEASE: ${{ steps.release-drafter.outputs.name }}
run: |
if [ ! -z "$RD_RELEASE" ]; then
echo "NEW_RELEASE=$RD_RELEASE" >> $GITHUB_ENV
else
echo "NEW_RELEASE=0.1.0" >> $GITHUB_ENV
fi
- name: Update version in pyproject.toml
uses: jacobtomlinson/gha-find-replace@master
with:
include: pyproject.toml
find: version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"
replace: version = "${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}"
- name: Commit updates
env:
SNAKEBIDS_VERSION: ${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "Bump version to $SNAKEBIDS_VERSION" -a
- name: Push changes
uses: CasperWA/push-protected@v2
with:
branch: ${{ github.event.pull_request.base.ref }}
token: ${{ secrets.BP_PAT_TOKEN }}
unprotect_reviews: true