Skip to content

Commit

Permalink
Merge pull request #268 from NotEnoughUpdates/master
Browse files Browse the repository at this point in the history
2.1 Continued
  • Loading branch information
Moulberry authored Oct 15, 2022
2 parents 7c6d37b + df02add commit 9dff9de
Show file tree
Hide file tree
Showing 804 changed files with 71,637 additions and 21,610 deletions.
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* text=auto

# Always Unix-style line endings
*.sh text eol=lf

# Always Windows-style line endings
*.bat text eol=crlf
*.cmd text eol=crlf

# Always binary
*.jpg -text
*.ogg -text
*.png -text
*.xcf -text
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributor Code of Conduct

Don't be a jerk.
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 16 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -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>`.
7 changes: 7 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -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.
86 changes: 45 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
49 changes: 49 additions & 0 deletions .github/workflows/infer.yml
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 20 additions & 1 deletion .github/workflows/send_webhook_update.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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=$?
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ out
*.iml
.idea/*
!.idea/codeStyles
!.idea/copyright

# gradle
build
Expand All @@ -23,3 +24,6 @@ gradle.properties
eclipse
run
.vscode
infer-out/
ciwork/
.DS_STORE
4 changes: 4 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/NotEnoughUpdates.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9dff9de

Please sign in to comment.