Skip to content

Commit

Permalink
Merge branch 'dev/feature' into java-8-end-of-life
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus authored Jun 30, 2024
2 parents 915b80c + df620e4 commit 720259a
Show file tree
Hide file tree
Showing 131 changed files with 5,017 additions and 1,481 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/archive-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Archive documentation

on:
release:
types: [published]
workflow_dispatch:

jobs:
archive-docs:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
needs: release-docs
runs-on: ubuntu-latest
steps:
- name: Configure workflow
id: configuration
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/archives/${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
- name: Checkout Skript
uses: actions/checkout@v4
with:
submodules: recursive
path: skript
- name: Setup documentation environment
uses: ./skript/.github/workflows/docs/setup-docs
with:
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
- name: Generate documentation
uses: ./skript/.github/workflows/docs/generate-docs
with:
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
is_release: true
generate_javadocs: true
- name: Push archive documentation
uses: ./skript/.github/workflows/docs/push-docs
with:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
git_name: Archive Docs Bot
git_email: archivedocs@skriptlang.org
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} archive docs"
4 changes: 2 additions & 2 deletions .github/workflows/docs/generate-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ runs:
cd $SKRIPT_REPO_DIR
if [[ "${IS_RELEASE}" == "true" ]]; then
./gradlew genReleaseDocs releaseJavadoc
./gradlew genReleaseDocs javadoc
elif [[ "${GENERATE_JAVADOCS}" == "true" ]]; then
./gradlew genNightlyDocs javadoc
else
./gradlew genNightlyDocs
fi
if [ -d "${DOCS_OUTPUT_DIR}" ]; then
if [[ "${GENERATE_JAVADOCS}" == "true" ]]; then
if [[ "${GENERATE_JAVADOCS}" == "true" ]] || [[ "${IS_RELEASE}" == "true" ]] ; then
mkdir -p "${SKRIPT_DOCS_OUTPUT_DIR}/javadocs" && cp -a "./build/docs/javadoc/." "$_"
fi
Expand Down
39 changes: 2 additions & 37 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release documentation
on:
release:
types: [published]
workflow_dispatch:

jobs:
release-docs:
Expand Down Expand Up @@ -33,6 +34,7 @@ jobs:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
is_release: true
generate_javadocs: true
cleanup_pattern: "!(nightly|archives|templates)"
- name: Push release documentation
uses: ./skript/.github/workflows/docs/push-docs
Expand All @@ -41,40 +43,3 @@ jobs:
git_name: Release Docs Bot
git_email: releasedocs@skriptlang.org
git_commit_message: "Update release docs to ${{ steps.configuration.outputs.BRANCH_NAME }}"

archive-docs:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
needs: release-docs
runs-on: ubuntu-latest
steps:
- name: Configure workflow
id: configuration
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/archives/${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT
- name: Checkout Skript
uses: actions/checkout@v4
with:
submodules: recursive
path: skript
- name: Setup documentation environment
uses: ./skript/.github/workflows/docs/setup-docs
with:
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
- name: Generate documentation
uses: ./skript/.github/workflows/docs/generate-docs
with:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }}
is_release: true
- name: Push archive documentation
uses: ./skript/.github/workflows/docs/push-docs
with:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
git_name: Archive Docs Bot
git_email: archivedocs@skriptlang.org
git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} archive docs"
37 changes: 8 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import java.time.LocalTime

plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.github.hierynomus.license' version '0.16.1'
id 'maven-publish'
id 'java'
}
Expand Down Expand Up @@ -55,7 +54,7 @@ task checkAliases {
}

task testJar(type: ShadowJar) {
dependsOn(compileTestJava, licenseTest)
dependsOn(compileTestJava)
archiveFileName = 'Skript-JUnit.jar'
from sourceSets.test.output, sourceSets.main.output, project.configurations.testShadow
}
Expand Down Expand Up @@ -141,24 +140,6 @@ publishing {
}
}

license {
header file('licenseheader.txt')
exclude('**/Metrics.java') // Not under GPLv3
exclude('**/BurgerHelper.java') // Not exclusively GPLv3
exclude('**/*.sk') // Sample scripts and maybe aliases
exclude('**/*.lang') // Language files do not have headers (still under GPLv3)
exclude('**/*.json') // JSON files do not have headers
}

task releaseJavadoc(type: Javadoc) {
title = project.name + ' ' + project.property('version')
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options.encoding = 'UTF-8'
// currently our javadoc has a lot of errors, so we need to suppress the linter
options.addStringOption('Xdoclint:none', '-quiet')
}

// Task to check that test scripts are named correctly
tasks.register('testNaming') {
doLast {
Expand Down Expand Up @@ -198,13 +179,12 @@ void createTestTask(String name, String desc, String environments, int javaVersi
if (junit) {
artifact += 'Skript-JUnit.jar'
} else if (releaseDocs) {
artifact += 'Skript-github.jar'
artifact += 'Skript-' + version + '.jar'
} else {
artifact += 'Skript-nightly.jar'
}
tasks.register(name, JavaExec) {
description = desc
dependsOn licenseTest
if (junit) {
dependsOn testJar
} else if (releaseDocs) {
Expand Down Expand Up @@ -307,7 +287,7 @@ task githubResources(type: ProcessResources) {
include '**'
version = project.property('version')
def channel = 'stable'
if (version.contains('pre'))
if (version.contains('-'))
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
Expand Down Expand Up @@ -340,7 +320,7 @@ task spigotResources(type: ProcessResources) {
include '**'
version = project.property('version')
def channel = 'stable'
if (version.contains('pre'))
if (version.contains('-'))
channel = 'prerelease'
filter ReplaceTokens, tokens: [
'version' : version,
Expand Down Expand Up @@ -378,7 +358,7 @@ task nightlyResources(type: ProcessResources) {
'today' : '' + LocalTime.now(),
'release-flavor' : 'skriptlang-nightly', // SkriptLang build, automatically done by CI
'release-channel' : 'prerelease', // No update checking, but these are VERY unstable
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No autoupdates for now
'release-updater' : 'ch.njol.skript.update.NoUpdateChecker', // No auto updates for now
'release-source' : '',
'release-download': 'null'
]
Expand All @@ -388,7 +368,7 @@ task nightlyResources(type: ProcessResources) {

task nightlyRelease(type: ShadowJar) {
from sourceSets.main.output
dependsOn nightlyResources, licenseMain
dependsOn nightlyResources
archiveFileName = 'Skript-nightly.jar'
manifest {
attributes(
Expand All @@ -400,8 +380,8 @@ task nightlyRelease(type: ShadowJar) {
}

javadoc {
dependsOn nightlyResources

mustRunAfter(tasks.withType(ProcessResources))
title = 'Skript ' + project.property('version')
source = sourceSets.main.allJava

exclude("ch/njol/skript/conditions/**")
Expand All @@ -420,4 +400,3 @@ javadoc {
// currently our javadoc has a lot of errors, so we need to suppress the linter
options.addStringOption('Xdoclint:none', '-quiet')
}

Loading

0 comments on commit 720259a

Please sign in to comment.