build: bump pygments from 2.16.1 to 2.17.2 #409
Workflow file for this run
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
# This workflow runs when a pull request is closed. | |
# | |
# - Job 1: | |
# - Gets list of PR labels. | |
# - Get current version from VERSION. | |
# - Determine next Semantic version. | |
# - Set next version. | |
# - IF one of 'bump: patch', 'bump: minor', or 'bump: major' tags: | |
# - Import GPG key. | |
# - Push version tag. | |
name: Close Pull Request Workflow | |
on: | |
pull_request: | |
branches: | |
- master | |
types: | |
- closed | |
jobs: | |
label_pr_closed: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add in progress label | |
uses: weibullguy/labeler@master | |
with: | |
add-labels: "status: closed" | |
remove-labels: "status: inprogress" | |
tag-version: | |
name: Push Version Tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ssh-key: "${{ secrets.COMMIT_KEY }}" | |
- name: Get PR labels | |
id: prlabels | |
uses: joerick/[email protected] | |
- name: Get current version | |
id: curversion | |
run: | | |
cur_version=$(cat VERSION) | |
ver_major=$(echo $cur_version | cut -d '.' -f1) | |
ver_minor=$(echo $cur_version | cut -d '.' -f2) | |
ver_patch=$(echo $cur_version | cut -d '.' -f3) | |
echo "cur_version=$cur_version" >> $GITHUB_OUTPUT | |
echo "ver_major=$ver_major" >> $GITHUB_OUTPUT | |
echo "ver_minor=$ver_minor" >> $GITHUB_OUTPUT | |
echo "ver_patch=$ver_patch" >> $GITHUB_OUTPUT | |
- name: Determine next Semantic version | |
id: semver | |
uses: WyriHaximus/github-action-next-semvers@v1 | |
with: | |
version: ${{ steps.curversion.outputs.cur_version }} | |
- name: Set next version | |
id: nextversion | |
run: | | |
if [ -n "$GITHUB_PR_LABEL_BUMP_MAJOR" ]; then | |
echo "next_version=${{ steps.semver.outputs.major }}" >> $GITHUB_OUTPUT | |
echo "do_release=1" >> $GITHUB_ENV | |
elif [ -n "$GITHUB_PR_LABEL_BUMP_MINOR" ]; then | |
echo "next_version=${{ steps.semver.outputs.minor }}" >> $GITHUB_OUTPUT | |
echo "do_release=1" >> $GITHUB_ENV | |
elif [ -n "$GITHUB_PR_LABEL_BUMP_PATCH" ]; then | |
echo "next_version=${{ steps.semver.outputs.patch }}" >> $GITHUB_OUTPUT | |
echo "do_release=1" >> $GITHUB_ENV | |
else | |
echo "next_version=${{ steps.curversion.outputs.cur_version }}" >> $GITHUB_OUTPUT | |
echo "do_release=0" >> $GITHUB_ENV | |
fi | |
- name: Import GPG key | |
if: ${{ env.do_release == 1 }} | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Push version tag | |
if: ${{ env.do_release == 1 }} | |
run: | | |
git config --global user.email "${{ steps.import_gpg.outputs.email }}" | |
git config --global user.name "${{ steps.import_gpg.outputs.name }}" | |
git tag -s -a -m"v${{ steps.nextversion.outputs.next_version }}" v${{steps.nextversion.outputs.next_version }} | |
git push --tags -f |