diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index aa20f0c..c6068d0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -30,8 +30,12 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" + - name: Bestimme Versionsnummer + id: version + run: echo ::set-env name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + - name: Erstelle Git-Tag - run: git tag $(date +'%Y%m%d%H%M%S') -a -m "Generierter Tag von GitHub Actions" + run: git tag v${{ steps.version.outputs.VERSION }} -a -m "Generierter Tag von GitHub Actions" - name: Sende Tags run: git push --tags --quiet @@ -44,8 +48,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }} - release_name: Release v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }} + tag_name: v${{ steps.version.outputs.VERSION }} + release_name: Release v${{ steps.version.outputs.VERSION }} draft: false prerelease: false @@ -55,6 +59,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./target/ExtremeDemonList-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-SNAPSHOT.jar - asset_name: ExtremeDemonList-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-SNAPSHOT.jar + asset_path: ./target/ExtremeDemonList-${{ steps.version.outputs.VERSION }}-SNAPSHOT.jar + asset_name: ExtremeDemonList-${{ steps.version.outputs.VERSION }}-SNAPSHOT.jar asset_content_type: application/java-archive