Skip to content

Commit

Permalink
Setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 21, 2024
1 parent 4d93acc commit f2371e5
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 34 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/build-prs.yml

name: Build and test PRs

on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:

jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 17
gradle_tasks: build
29 changes: 0 additions & 29 deletions .github/workflows/build.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/publish-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/publish-prs.yml

name: Publish PRs to GitHub Packages

on:
workflow_run:
workflows: [Build and test PRs]
types:
- completed
issue_comment:
types:
- edited
pull_request_target:
types:
- opened

permissions:
packages: write

jobs:
publish-prs:
if: false # Option not enabled when the workflows were generated
uses: neoforged/actions/.github/workflows/publish-prs.yml@main
with:
artifact_base_path: dev/su5ed/sinytra/fabric-loader/
secrets:
PR_PUBLISHING_GH_APP_ID: ${{ secrets.PR_PUBLISHING_GH_APP_ID }}
PR_PUBLISHING_GH_APP_KEY: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly
# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/release.yml

name: Release

on:
push:
branches:
- '1.*'

permissions:
contents: read
statuses: write

jobs:
release:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 17
pre_gradle_tasks: build
gradle_tasks: publish
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MAVEN_USER: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
13 changes: 8 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ plugins {
java
`maven-publish`
id("net.minecraftforge.gradle") version "[6.0,6.2)"
id("me.qoomon.git-versioning") version "6.3.+"
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("net.neoforged.gradleutils").version("3.0.0-alpha.10")
// Used for mapping tools only, provides TSRG writer on top of mappings-io
id("dev.architectury.loom") version "1.2-SNAPSHOT" apply false
}
Expand All @@ -33,11 +33,14 @@ val versionYarn: String by project
group = "dev.su5ed.sinytra"
version = "0.0.0-SNAPSHOT"

gitVersioning.apply {
rev {
version = "\${describe.tag.version.major}.\${describe.tag.version.minor}.\${describe.tag.version.patch.plus.describe.distance}+$versionLoaderUpstream+$versionMc"
gradleutils.version {
branches {
suffixBranch()
suffixExemptedBranch("1.20.1")
}
}
version = "${gradleutils.version}+$versionLoaderUpstream+$versionMc"
println("Version: $version")

license {
header("HEADER")
Expand Down Expand Up @@ -218,4 +221,4 @@ open class GenerateMergedMappingsTask : DefaultTask() {
mergedTree.accept(destFiler)
outputFile.get().asFile.toPath().writeText(Tsrg2Writer.serialize(filteredTree), Charsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
}
}
}

0 comments on commit f2371e5

Please sign in to comment.