Skip to content

Commit

Permalink
Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Split50 committed Jul 30, 2024
1 parent 0e64343 commit 8bbce22
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ java {
}
}

tasks.jar {
enabled = false
}

repositories {
mavenCentral()
}
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit 8bbce22

Please sign in to comment.