Skip to content

auto increment version #1175

auto increment version

auto increment version #1175

Workflow file for this run

name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Dependency Test
run: mvn test -Dtest=org.myrobotlab.framework.DependencyTest -q
- name: Build and Test with Maven
run: mvn --batch-mode -Dtest=!**/OpenCV* test -q
- name: Package with Maven
run: mvn package -DskipTests
- name: Determine Next Version
id: next_version
run: |
latest_release_tag=$(git describe --tags --abbrev=0)
major_minor="1.1."
current_version="${latest_release_tag#v}"
increment_version=$((current_version + 1))
next_version="${major_minor}${increment_version}"
echo "::set-output name=next_version::${next_version}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.next_version.outputs.next_version }}
release_name: Release ${{ steps.next_version.outputs.next_version }}
draft: false
prerelease: false
- name: Upload Release Artifacts
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/myrobotlab.zip
asset_name: myrobotlab.zip
asset_content_type: application/zip