Auto Bump Patch #40
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
name: Auto Bump Patch | |
on: | |
release: | |
types: [prereleased] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Bump version in tauri.conf.json and tauri.android.conf.json | |
id: bump_version | |
run: | | |
CURRENT_VERSION=$(jq -r '.version' src-tauri/tauri.conf.json) | |
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION" | |
MAJOR=${VERSION_PARTS[0]} | |
MINOR=${VERSION_PARTS[1]} | |
PATCH=${VERSION_PARTS[2]} | |
NEW_PATCH=$((PATCH + 1)) | |
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" | |
jq --indent 4 ".version = \"$NEW_VERSION\"" src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp && mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json | |
jq --indent 4 ".version = \"$NEW_VERSION\"" src-tauri/tauri.android.conf.json > src-tauri/tauri.android.conf.json.tmp && mv src-tauri/tauri.android.conf.json.tmp src-tauri/tauri.android.conf.json | |
echo "new_version=$NEW_VERSION" >> "$GITHUB_ENV" | |
- name: Set up GPG key | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import | |
KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2) | |
echo "GPG Key ID: $KEY_ID" | |
git config --global user.signingkey "$KEY_ID" | |
echo $GPG_PASSPHRASE | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback --sign -o /dev/null | |
- name: Configure Git user | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "chore(version) : bump to ${{ env.new_version }}" | |
base: main | |
branch: chore/bump-version-${{ env.new_version }} | |
branch-suffix: random | |
title: "chore(version): bump version to ${{ env.new_version }}" | |
draft: false |