Skip to content

Increment version

Increment version #141

name: "Increment version"
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Setup git user
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Update Version
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
export VERSION=`grep Bundle-Version org.sf.feeling.decompiler/META-INF/MANIFEST.MF | cut -d: -f2 | xargs`
export MAJOR=`echo $VERSION | cut -d. -f1`
export MINOR=`echo $VERSION | cut -d. -f2`
export PATCH=`echo $VERSION | cut -d. -f3`
export NEW_PATCH=`expr $PATCH + 1`
export NEW_VERSION=$MAJOR.$MINOR.$NEW_PATCH
chmod u+x ./update-version.sh
./update-version.sh $NEW_VERSION
git commit -a -m "[update version] $VERSION -> $NEW_VERSION"
git push
git tag -a $NEW_VERSION -m "$NEW_VERSION"
git push origin $NEW_VERSION