Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 13 additions & 8 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: zulu
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --scan --no-daemon
arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster
generate-job-summary: true
gradle-home-cache-includes: |
caches
jdks
notifications
wrapper

- name: Upload Jars
uses: actions/upload-artifact@v3
- name: Publish to GitHub
uses: softprops/action-gh-release@v1
with:
name: GTExpert-Core
path: build/libs/*.jar
files: "build/libs/*.jar"
generate_release_notes: true
fail_on_unmatched_files: true
71 changes: 71 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Publishes built jars to distribution platforms
name: Publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # any semver tag, e.g. v1.2.3

env:
# link to the changelog with a format code for the version
CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{github.repository}}/releases/tag/${{github.ref_name}})"
# type of release
RELEASE_TYPE: "beta"

jobs:
Publish:
runs-on: ubuntu-latest

permissions:
contents: write # needed to create GitHub releases

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Check for Duplicate Tags
run: |
if git rev-parse -q --verify "refs/tags/${{ github.ref }}" >/dev/null; then
echo "Tag already exists. A version bump is required."
exit 1
fi

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17

- name: Build Project
uses: gradle/gradle-build-action@v2
with:
arguments: 'build --build-cache --daemon' # use the daemon here so the rest of the process is faster
generate-job-summary: false
gradle-home-cache-includes: |
caches
jdks
notifications
wrapper

- name: Publish to GitHub
uses: softprops/action-gh-release@v1
with:
files: "build/libs/*.jar"
generate_release_notes: true
fail_on_unmatched_files: true

- name: Publish to Curseforge
uses: gradle/gradle-build-action@v2
env:
CURSEFORGE_API_KEY: "${{secrets.CURSEFORGE_API_KEY}}"
CURSEFORGE_PROJECT_ID: "${{secrets.CURSEFORGE_PROJECT_ID}}"
CHANGELOG_LOCATION: "${{env.CHANGELOG_LOCATION}}"
RELEASE_TYPE: "${{env.RELEASE_TYPE}}"
with:
arguments: 'curseforge --daemon'
generate-job-summary: false
gradle-home-cache-includes: |
caches
jdks
notifications
wrapper
46 changes: 0 additions & 46 deletions .github/workflows/release.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/update_buildscript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Checks daily to see if the buildscript is in need of an update
name: Buildscript Updating

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # "min hr day month year", so run once per day

jobs:
buildscript-update:
runs-on: ubuntu-latest
# Avoid running this workflow on forks
if: github.repository == 'GregTechCEu/GregTech'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Ensure build script version is up to date
id: update-buildscript
run: |
curl https://raw.githubusercontent.com/GregTechCEu/Buildscripts/master/build.gradle --output build.gradle
new_version=$(head -1 build.gradle | sed -r 's|//version: (.*)|\1|g')
echo "NEW_VERSION=$new_version" >> "$GITHUB_OUTPUT"

- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.BUILDSCRIPT_UPDATER_TOKEN }}
with:
token: ${{ secrets.BUILDSCRIPT_UPDATER_TOKEN }}
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
add-paths: build.gradle
commit-message: 'update build script version to ${{ steps.update-buildscript.outputs.NEW_VERSION }}'
branch: gha-update-buildscript
title: Update build script version to ${{ steps.update-buildscript.outputs.NEW_VERSION }}
body: This pull request is created by the buildscript-update workflow
labels: ignore changelog
6 changes: 6 additions & 0 deletions addon.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
Loading