name: Java CI/CD on: push: tags: [ "v*" ] jobs: create_release: name: Create Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up JDK 8 uses: actions/setup-java@v2 with: java-version: '8' distribution: 'adopt' - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: 18 - name: Build with Maven run: mvn clean compile assembly:single - name: Get version id: get_version run: echo "::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' exec:exec)" - name: Get artifact id id: get_artifact_id run: echo "::set-output name=name::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' exec:exec)" - name: Rename artifact run: mv ./target/${{ steps.get_artifact_id.outputs.name }}.jar ./target/${{ steps.get_artifact_id.outputs.name }}-${{ steps.get_version.outputs.version }}.jar - name: Automatic Releases uses: marvinpinto/action-automatic-releases@latest with: repo_token: ${{ secrets.GITHUB_TOKEN }} prerelease: false title: Release ${{ steps.get_version.outputs.version }} files: | ./target/${{ steps.get_artifact_id.outputs.name }}-${{ steps.get_version.outputs.version }}.jar