diff --git a/.github/workflows/build-and-publish-release.yml b/.github/workflows/build-and-publish-release.yml new file mode 100644 index 000000000..d7f0be3bb --- /dev/null +++ b/.github/workflows/build-and-publish-release.yml @@ -0,0 +1,35 @@ +name: Build and Publish Release + +on: + push: + branches: + - main # Change this to your main branch name + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: '11' # You can change this to your desired Java version + + - name: Build JAR + run: | + ./gradlew build # Change this to your build command, e.g., `mvn package` + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + files: path/to/your/jarfile.jar # Replace with the actual path to your JAR file + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Release URL + id: release_url + run: echo "Release URL::https://github.com/${{ github.repository }}/releases/tag/${{ steps.create_release.outputs.id }}"