Skip to content

Commit

Permalink
more yml scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Colack committed Oct 18, 2024
1 parent d8e37fc commit ef539b7
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/increment-major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Increment Major Version

on:
push:
branches:
- main

jobs:
increment-major:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Read and increment version
run: |
VERSION_FILE=".version"
CURRENT_VERSION=$(cat $VERSION_FILE)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "$NEW_VERSION" > $VERSION_FILE
echo "Version updated to $NEW_VERSION"
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "CubeDood"
git add .version
git commit -m "Increment major version to $NEW_VERSION"
git push
env:
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/increment-minor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Increment Minor Version

on:
push:
branches:
- main

jobs:
increment-minor:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Read and increment version
run: |
VERSION_FILE=".version"
CURRENT_VERSION=$(cat $VERSION_FILE)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
MINOR=$((MINOR + 1))
PATCH=0
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "$NEW_VERSION" > $VERSION_FILE
echo "Version updated to $NEW_VERSION"
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "CubeDood"
git add .version
git commit -m "Increment minor version to $NEW_VERSION"
git push
env:
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/increment-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Increment Patch Version

on:
push:
branches:
- main

jobs:
increment-patch:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Read and increment version
run: |
VERSION_FILE=".version"
CURRENT_VERSION=$(cat $VERSION_FILE)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "$NEW_VERSION" > $VERSION_FILE
echo "Version updated to $NEW_VERSION"
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "CubeDood"
git add .version
git commit -m "Increment patch version to $NEW_VERSION"
git push
env:
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Use your desired Node.js version
node-version: '16'

- name: Install dependencies
run: npm install
Expand All @@ -36,7 +36,7 @@ jobs:
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ env.VERSION }}" # Use the version from the file as the tag name
tag_name: "${{ env.VERSION }}"
files: "${{ env.VERSION }}.zip"
env:
GITHUB_TOKEN: ${{ secrets.CUBEDOOD_TOKEN }}
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.111
0.0.0

0 comments on commit ef539b7

Please sign in to comment.