diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/CODEOWNERS | 11 | ||||
-rw-r--r-- | .github/CODE_OF_CONDUCT.md | 3 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 34 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/config.yml | 8 | ||||
-rw-r--r-- | .github/SECURITY.md | 16 | ||||
-rw-r--r-- | .github/SUPPORT.md | 7 | ||||
-rw-r--r-- | .github/workflows/build.yml | 86 | ||||
-rw-r--r-- | .github/workflows/infer.yml | 49 | ||||
-rwxr-xr-x | .github/workflows/send_webhook_update.sh | 21 |
9 files changed, 159 insertions, 76 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..94fc9f8f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,11 @@ +/src/main/java/io/github/moulberry/notenoughupdates/recipes/* @romangraef +/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @romangraef +/*gradle* @romangraef +/README.md @IRONM00N +/CONTRIBUTING.md @romangraef @IRONM00N +/.editorconfig @IRONM00N +/.github/CODE_OF_CONDUCT.md @IRONM00N +/.github/SECURITY.md @IRONM00N +/.github/SUPPORT.md @IRONM00N +/.idea/codeStyles/* @IRONM00N +/.idea/copyright/* @IRONM00N diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..e91612f1 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Contributor Code of Conduct + +Don't be a jerk. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 5e58389d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Help Moulberry pinpoint problems. -title: '[Bug] Title' -labels: '' -assignees: '' - ---- - -<!-- -Before you begin check if the bug already been reported. -And also ensure you are using the latest version. - - -If you are unsure about these requirements or need general support, -please join the discord server at discord.gg/moulberry ---> - -<!-- This is asking for the mod version for example 1.7.3-REL --> -**Mod Version:** - -<!-- Provide a clear and concise description of what the bug is. --> -**Describe the bug** - -<!-- Steps to reproduce the behavior --> -**To Reproduce** -1. -2. - -<!-- A clear and concise description of what you expected to happen. --> -**Expected behavior** - -<!-- Add screenshots, crash logs etc. --> -**Attachments**
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0063ceed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: NEU Support + url: https://discord.gg/moulberry + about: "Please ask for support in #neu-support on Moulberry's discord." + - name: Report security vulnerabilities + url: https://discord.gg/moulberry + about: "If you wish to discuss a bug *with security implications* privately, please open a ticket in Moulberry's discord using /new in #bot-commands" diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000..7ddab381 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +The following versions of the mod support security updates. + +| Version | Supported | +| ------- | ------------------ | +| < 2.0 | :x: | +| 2.0.x | :white_check_mark: | +| 2.1.x | :white_check_mark: | + +## Reporting a Vulnerability + +Please report vulnerabilities in our [discord server](https://discord.gg/moulberry) by creating a new +ticket in #bot-commands with the command `/new <reason>`. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 00000000..24328844 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,7 @@ +<!-- markdownlint-disable MD034 --> + +# Obtain Support for NotEnoughUpdates + +If you are struggling to install the mod, having issues with it, experiencing +unexpected crashes, or have another issue: join our community [discord server](https://discord.gg/moulberry) +and ask for help in the #neu-support channel. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b6d0cbd..639d3965 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,18 +3,22 @@ name: Build on: push: branches: - - '*' + - "*" paths-ignore: - - 'README.md' - - 'LICENSE' - - '.gitignore' + - "README.md" + - "COPYING" + - "COPYING.LESSER" + - ".gitignore" + - "Update Notes" pull_request: branches: - - '*' + - "*" paths-ignore: - - 'README.md' - - 'LICENSE' - - '.gitignore' + - "README.md" + - "COPYING" + - "COPYING.LESSER" + - ".gitignore" + - "Update Notes" workflow_dispatch: jobs: build: @@ -26,36 +30,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Send discord notification - id: sendmsg - if: ${{ env.WEBHOOK_URL }} - run: | - ./.github/workflows/send_webhook_update.sh - env: - STATUS: WORKING - - name: Set up JDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: zulu - cache: gradle - - name: Build with Gradle - run: chmod +x ./gradlew && ./gradlew setupCIWorkspace build --no-daemon - - uses: actions/upload-artifact@v2 - with: - path: build/libs/*-dep.jar - - name: Update discord notification - if: ${{ env.WEBHOOK_URL && success() }} - run: | - ./.github/workflows/send_webhook_update.sh - env: - STATUS: SUCCESS - MESSAGE_ID: ${{ steps.sendmsg.outputs.MESSAGE_ID }} - - name: Update discord notification - if: ${{ env.WEBHOOK_URL && failure() }} - run: | - ./.github/workflows/send_webhook_update.sh - env: - STATUS: FAILURE - MESSAGE_ID: ${{ steps.sendmsg.outputs.MESSAGE_ID }} + - uses: actions/checkout@v2 + - name: Send discord notification + id: sendmsg + if: ${{ env.WEBHOOK_URL }} + run: | + ./.github/workflows/send_webhook_update.sh + env: + STATUS: WORKING + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: temurin + cache: gradle + - name: Build with Gradle + run: chmod +x ./gradlew && ./gradlew clean test remapJar --no-daemon + - uses: actions/upload-artifact@v2 + with: + path: build/libs/*-dep.jar + - name: Update discord notification + if: ${{ env.WEBHOOK_URL && success() }} + run: | + ./.github/workflows/send_webhook_update.sh + env: + STATUS: SUCCESS + MESSAGE_ID: ${{ steps.sendmsg.outputs.MESSAGE_ID }} + - name: Update discord notification + if: ${{ env.WEBHOOK_URL && failure() }} + run: | + ./.github/workflows/send_webhook_update.sh + env: + STATUS: FAILURE + MESSAGE_ID: ${{ steps.sendmsg.outputs.MESSAGE_ID }} diff --git a/.github/workflows/infer.yml b/.github/workflows/infer.yml new file mode 100644 index 00000000..365e748b --- /dev/null +++ b/.github/workflows/infer.yml @@ -0,0 +1,49 @@ +name: Infer + +on: + - pull_request + - workflow_dispatch +jobs: + inferering: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Checkout feature + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: temurin + cache: gradle + - name: Setup Infer + uses: srz-zumix/setup-infer@v1 + - name: Run Infer on feature + run: | + echo On commit $(git log --pretty=%s -1) + mkdir -p ciwork + infer capture -- ./gradlew clean test --no-daemon + infer analyze + cp infer-out/report.json ciwork/report-feature.json + - uses: actions/checkout@v2 + name: Checkout base + with: + ref: ${{ github.event.pull_request.base.sha }} + clean: false + - name: Run Infer on base + run: | + echo On commit $(git log --pretty=%s -1) + infer capture --reactive -- ./gradlew clean test --no-daemon + infer analyze --reactive + - name: Generate report + run: | + infer reportdiff --report-current ciwork/report-feature.json --report-previous infer-out/report.json + jq -r '.[] | select(.severity == "ERROR") | ("::error file="+.file +",line=" +(.line|tostring)+"::" + .qualifier)' <infer-out/differential/introduced.json + jq -r '.[] | select(.severity == "WARNING") | ("::warning file="+.file +",line=" +(.line|tostring)+"::" + .qualifier)' <infer-out/differential/introduced.json + fixcount=$(jq -r "length" <infer-out/differential/fixed.json) + unfixcount=$(jq -r "length" <infer-out/differential/introduced.json) + othercount=$(jq -r "length" <infer-out/differential/preexisting.json) + echo "This PR fixes $fixcount potential bug(s), introduces $unfixcount potential bug(s). (Total present in feature branch: $((unfixcount + othercount)))" >>$GITHUB_STEP_SUMMARY + [[ $unfixcount != 0 ]] && exit 1 || echo ok. diff --git a/.github/workflows/send_webhook_update.sh b/.github/workflows/send_webhook_update.sh index 56852159..f0eb0051 100755 --- a/.github/workflows/send_webhook_update.sh +++ b/.github/workflows/send_webhook_update.sh @@ -1,4 +1,23 @@ #!/bin/bash +# +# Copyright (C) 2022 NotEnoughUpdates contributors +# +# This file is part of NotEnoughUpdates. +# +# NotEnoughUpdates is free software: you can redistribute it +# and/or modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. +# +# NotEnoughUpdates is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. +# + set -x COLOR_SUCCESS=8040199 @@ -69,7 +88,7 @@ function make_request() { curl -X $1 -H "Content-Type: multipart/form-data" -F "payload_json=$json" "$upload_arg" "$upload_name=@$to_upload" "$WEBHOOK_URL$2?wait=true" } -echo "Should replace message with id: $MESSAGE_ID" +echo "Should replace message with id: <$MESSAGE_ID>" if [ "$MESSAGE_ID" != "" ]; then discord_output=$(make_request PATCH "/messages/$MESSAGE_ID") RESULT=$? |