From 08340da0b08b7d89c532732050bb383948c8c7ed Mon Sep 17 00:00:00 2001 From: Mouse Date: Sat, 6 May 2023 18:38:10 +0800 Subject: [PATCH] Init --- .github/workflows/Build.yml | 48 +++++++++++++++++++++++++++++++++++++ gradle.properties | 3 +++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/Build.yml create mode 100644 gradle.properties diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 0000000..f265223 --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,48 @@ +name: Build +on: + release: + types: [published] +defaults: + run: + shell: pwsh +jobs: + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Config + run: | + Write-Output "${{ github.event.release.body }}" >> $env:GITHUB_ENV + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: ${{ env.java_version }} + - name: Initalize + run: | + New-Item -Type Directory ~\.gradle + Move-Item .\gradle.properties ~\.gradle\gradle.properties + New-Item -Type Directory ${{ env.archive_name }} + Set-Location ${{ env.archive_name }} + git clone -b ${{ env.branch }} ${{ env.repo }} + Get-ChildItem | Select-Object -ExpandProperty Name -First 1 | Set-Location + git checkout ${{ env.commit }} + Remove-Item ./.git -Recurse -Force + - name: Run Gradle Task + run: | + Set-Location ${{ env.archive_name }} + Get-ChildItem | Select-Object -ExpandProperty Name -First 1 | Set-Location + .\gradlew ${{ env.task }} + - name: Package + run: | + Move-Item ~\.gradle .\${{ env.archive_name }}\.gradle + Compress-Archive .\${{ env.archive_name }} ${{ env.archive_name }}.zip + - name: Upload + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ env.archive_name }}.zip + asset_name: ${{ env.archive_name }}.zip + asset_content_type: application/zip + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6aa1ec3 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.daemon=false +org.gradle.disable.cache.cleanup=true +org.gradle.cache.cleanup=false \ No newline at end of file