Skip to content

Commit

Permalink
backport changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle committed Aug 2, 2023
1 parent c361597 commit 8521bac
Show file tree
Hide file tree
Showing 45 changed files with 966 additions and 877 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build
on:
pull_request:

jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

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

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
74 changes: 23 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,50 @@
name: Build & Release
on:
release:
types: [ created ]
types: [created]

jobs:
build:
name: Release
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 20
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
distribution: temurin

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Update mod version
uses: christian-draeger/[email protected]
with:
path: 'gradle.properties'
property: 'mod_version'
path: "gradle.properties"
property: "mod_version"
value: ${{ github.event.release.tag_name }}

- name: build
run: ./gradlew build

- name: publish to github packages
run: ./gradlew publish
- name: Build and upload
uses: gradle/gradle-build-action@v2
with:
arguments: build curseforge modrinth publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: upload to curseforge
run: ./gradlew curseforge
continue-on-error: true
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}

- name: upload to modrinth
run: ./gradlew modrinth
continue-on-error: true
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}
CI: true

- name: Upload forge jar to release
if: ${{ github.event_name == 'release' }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload fabric jar to github releases
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: forge/build/libs/brazier-forge-${{ github.event.release.tag_name }}.jar
asset_name: brazier-forge-${{ github.event.release.tag_name }}.jar
asset_content_type: application/java-archive
file: fabric/build/libs/brazier-fabric-${{ github.event.release.tag_name }}.jar

- name: Upload fabric jar to release
if: ${{ github.event_name == 'release' }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload forge jar to github releases
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: fabric/build/libs/brazier-fabric-${{ github.event.release.tag_name }}.jar
asset_name: brazier-fabric-${{ github.event.release.tag_name }}.jar
asset_content_type: application/java-archive
file: forge/build/libs/brazier-forge-${{ github.event.release.tag_name }}.jar
26 changes: 13 additions & 13 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
name: Analyze
on:
push:
pull_request:
branches: [1.18.x]

jobs:
build:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache SonarQube packages
uses: actions/cache@v2
Expand All @@ -34,9 +31,12 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze
- name: Build and upload
uses: gradle/gradle-build-action@v2
with:
arguments: build sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew build sonarqube
CI: true
164 changes: 0 additions & 164 deletions CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 8521bac

Please sign in to comment.