Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Nov 3, 2024
1 parent 9b8c0df commit 7f72968
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ jobs:
- name: Increment version and build with Maven
id: increment-version
run: |
START_VERSION="2.0.1903"
CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Current version: $CURRENT_VERSION"
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F '.' '{print $1"."$2"."$3+1}')
if [[ "$CURRENT_VERSION" == "0.0.1-SNAPSHOT" ]]; then
NEW_VERSION=$START_VERSION
else
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F '.' '{print $1"."$2"."$3+1}')
fi
echo "New version: $NEW_VERSION"
echo "artifact-version=$NEW_VERSION" >> $GITHUB_ENV
Expand All @@ -44,7 +48,7 @@ jobs:
if: success()

steps:
- name: Checkout code.
- name: Checkout code
uses: actions/checkout@v3

- name: Upload to S3
Expand All @@ -63,3 +67,12 @@ jobs:
- name: Verify artifact upload
run: |
aws s3 ls s3://your-bucket-name/maven-repo/path/to/artifact/
- name: Create Git tag for version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git tag -a "v${{ env.artifact-version }}" -m "Release version ${{ env.artifact-version }}"
git push origin "v${{ env.artifact-version }}"

0 comments on commit 7f72968

Please sign in to comment.