From dd7ab4116f546772732197d1211555518c5afb5b Mon Sep 17 00:00:00 2001 From: prettierrc Date: Sat, 13 Jan 2024 15:48:19 -0500 Subject: [PATCH] github actions --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ build.gradle | 9 +++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7b60948 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build and Release +on: [push] +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '8' + cache: gradle + + - name: Build with Gradle + run: gradle -Pversion=${{ github.run_number }} build + + - name: Move JARs + run: mkdir staging && cp build/libs/*.jar staging + + - name: Create Release + uses: "marvinpinto/action-automatic-releases@latest" + with: + title: Build ${{ github.run_number }} + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + automatic_release_tag: "v${{ github.run_number }}" + files: | + staging/moosic-${{ github.run_number }}.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index d792a2b..85a91ec 100644 --- a/build.gradle +++ b/build.gradle @@ -30,3 +30,12 @@ dependencies { test { useJUnitPlatform() } + +jar { + manifest { + attributes( + 'Main-Class': 'Main' + ) + } +} +