diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..44213df --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish + +on: + push: + tags: + - 'v*.*.*' + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download JAR artifact + uses: actions/download-artifact@v2 + with: + name: app-jar + path: . + + - name: Publish JAR file + run: | + version=${GITHUB_REF#refs/tags/} + jar_file=$(ls *.jar) + new_name="${version}.jar" + mv "$jar_file" "$new_name" + gh release create "$version" "$new_name" --notes "Release $version" \ No newline at end of file