diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 22 | ||||
-rw-r--r-- | .github/workflows/gradle-wrapper-validation.yml | 10 | ||||
-rw-r--r-- | .github/workflows/init.yml | 38 |
3 files changed, 70 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d794684 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Run Gradle Build +on: [push, pull_request] +jobs: + gradle: + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + name: Setup Java + with: + distribution: temurin + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Execute Gradle build + run: ./gradlew build + - uses: actions/upload-artifact@v3 + name: Upload built mod JAR + with: + name: mod-jar + path: build/libs/*.jar
\ No newline at end of file diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000..91e75b3 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,10 @@ +name: "Validate Gradle Wrapper" +on: [push, pull_request] + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1
\ No newline at end of file diff --git a/.github/workflows/init.yml b/.github/workflows/init.yml new file mode 100644 index 0000000..c18810f --- /dev/null +++ b/.github/workflows/init.yml @@ -0,0 +1,38 @@ +name: Initialize Template Repo +on: + - push + +permissions: + contents: write + +jobs: + cleanup: + name: "Initialize Repo" + runs-on: ubuntu-latest + if: github.event.repository.name != 'Forge1.8.9Template' + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize Repo + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + owner=$(echo $GITHUB_REPOSITORY | cut -d/ -f1 | tr '[:upper:]' '[:lower:]') + name=$(echo $GITHUB_REPOSITORY | cut -d/ -f2 | tr '[:upper:]' '[:lower:]' | tr -d "-" | tr -d ".") + pack_name="com.github.${owner,,}.${name,,}" + proj_name="$(echo $GITHUB_REPOSITORY | cut -d/ -f2)" + modid="$(echo $name | sed 's/[^a-z]//g')" + ./make-my-own.sh "$pack_name" "$proj_name" "$modid" + git add . + git commit -F- <<EOF + Initialize template repository proper + + Set package name to $pack_name + Set project name to $proj_name + Set modid to $modid + EOF + - name: Push changes + uses: ad-m/github-push-action@v0.6.0 + with: + branch: ${{ github.ref }} + github_token: ${{ secrets.GITHUB_TOKEN }} |