diff options
| author | ilotterytea <iltsu@alright.party> | 2022-11-25 18:23:14 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-11-25 18:23:14 +0600 |
| commit | 7e4562c323cdcf323b5067261fcae002508fadd6 (patch) | |
| tree | 92f71acbb3b35ae5876321b6bff73b14df63e8b5 /.github/workflows | |
| parent | 283378f20bb1e8cd8e7b09ad479a961fddfd2e44 (diff) | |
Build the game automatically
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/release.yml | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5405a76 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Build the game and save as draft release. + +on: + push: + branches: [ master ] + + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build for desktop + run: ./gradlew desktop:dist + + - name: Upload the game + uses: actions/upload-artifact@v2 + with: + name: Maxoning.jar + path: desktop/build/libs/Maxoning.jar + + release: + needs: [ build ] + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + + - name: Create release + id: create_release + uses: actions/create-release@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref}} + draft: true + prerelease: false + + - name: Upload JAR release + uses: actions/upload-release-asset@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/Maxoning.jar + asset_name: Maxoning.jar + asset_content_type: application/x-java-archive |
