mirror of https://github.com/buster-so/buster.git
Merge branch 'main' into staging
This commit is contained in:
commit
1bdf41a063
|
@ -0,0 +1,69 @@
|
|||
name: Update Version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# Add permissions configuration
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
version-bump:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Add condition to skip if last commit was a release
|
||||
if: "!startsWith(github.event.head_commit.message, 'chore(release)')"
|
||||
|
||||
steps:
|
||||
# Step 1: Check out the repository
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history
|
||||
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
|
||||
|
||||
# Step 2: Determine Version
|
||||
- name: Determine Version
|
||||
id: get_version
|
||||
run: |
|
||||
if [ ! -f "version.txt" ]; then
|
||||
echo "0.0.1" > version.txt
|
||||
fi
|
||||
|
||||
CURRENT_VERSION=$(cat version.txt)
|
||||
echo "Current Version: $CURRENT_VERSION"
|
||||
|
||||
# Split version into components
|
||||
IFS='.' read -r -a version_parts <<< "$CURRENT_VERSION"
|
||||
MAJOR="${version_parts[0]}"
|
||||
MINOR="${version_parts[1]}"
|
||||
PATCH="${version_parts[2]}"
|
||||
|
||||
# Increment patch version
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
|
||||
|
||||
echo "New Version: $NEW_VERSION"
|
||||
|
||||
# Export versions for later steps
|
||||
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
|
||||
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
||||
|
||||
# Step 3: Update version.txt if version changes
|
||||
- name: Update version.txt
|
||||
if: env.CURRENT_VERSION != env.NEW_VERSION
|
||||
run: |
|
||||
echo "$NEW_VERSION" > version.txt
|
||||
|
||||
# Step 4: Commit and Push Changes
|
||||
- name: Commit and Push Changes
|
||||
if: env.CURRENT_VERSION != env.NEW_VERSION
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add version.txt
|
||||
git commit -m "chore(release): update version to $NEW_VERSION"
|
||||
git push "https://${{ github.actor }}:${{ secrets.MY_RELEASE_PLEASE_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"packages": {
|
||||
".": {
|
||||
"release-type": "simple",
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"prerelease": true
|
||||
}
|
||||
},
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<a href="https://github.com/buster-so/warehouse/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-red.svg?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://github.com/buster-so/warehouse/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/License-MIT-red.svg?style=flat-square" ></a>
|
||||
<a href="https://www.ycombinator.com/companies/buster"><img src="https://img.shields.io/badge/Y%20Combinator-W24-orange?style=flat-square" alt="Y Combinator W24"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
buster=0.0.1
|
||||
.=0.0.1
|
||||
0.0.5
|
||||
|
|
Loading…
Reference in New Issue