diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..7255a43 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,60 @@ +name: Build and Release +on: + push: + tags: [ '*' ] # Запуск при создании тега + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 + with: + arguments: build + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + name: bunnybooru + path: | + build/libs/BunnyBooru-*.jar + + release: + needs: build + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Download Build Artifact + uses: actions/download-artifact@v2 + with: + name: bunnybooru + path: build/libs/ + - name: Get Artifact Filename + id: get_filename + run: echo "FILENAME=$(basename build/libs/BunnyBooru-*.jar)" >> $GITHUB_ENV + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/libs/${{ env.FILENAME }} + asset_name: ${{ env.FILENAME }} + asset_content_type: application/java-archive \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 2196603..9b90d53 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,6 +14,10 @@ java { } } +tasks.jar { + enabled = false +} + repositories { mavenCentral() } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755