Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto build 1.17.1 #5

Open
wants to merge 1 commit into
base: ver/1.17.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build and release
on: push
jobs:
constants:
runs-on: ubuntu-latest
outputs:
minecraft-version: "1.17.1"
java-version: "17"
steps:
- run: echo constants
build:
needs: [constants]
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.get-filename.outputs.filename }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache Gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: ${{ needs.constants.outputs.java-version }}
- name: Configure Git User Details
run: git config --global user.email "[email protected]" && git config --global user.name "Github Actions"
- name: Apply Patches
run: ./gradlew applyPatches --stacktrace
- name: Build
run: ./gradlew build --stacktrace
- name: Get file name
id: get-filename
run: echo ::set-output name=filename::$(ls -1 ./build/libs/)
- name: Upload artifact
uses: actions/upload-artifact@v2
if: "!failure()"
with:
name: jar
path: build/libs/${{ steps.get-filename.outputs.filename }}
release:
runs-on: ubuntu-latest
needs: [build,constants]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: jar
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.constants.outputs.minecraft-version }}-${{ github.run_number }}
release_name: ${{ needs.constants.outputs.minecraft-version }}-${{ github.run_number }} ${{ github.event.head_commit.message }}
body: ""
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ needs.build.outputs.filename }}
asset_name: ${{ needs.build.outputs.filename }}
asset_content_type: application/zip