Skip to content

Commit

Permalink
Merge branch 'ss220club:master' into rave-wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
HelmsDeepState authored Apr 13, 2024
2 parents a4a4192 + 330eb74 commit 324f9f7
Show file tree
Hide file tree
Showing 2,271 changed files with 184,771 additions and 99,065 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Merger hooks, run tools/hooks/install.bat or install.sh to set up
## Merge hooks, run tools/hooks/install.bat or install.sh to set up
*.dmm text eol=lf merge=dmm
*.dmi binary merge=dmi
## TGUI bundle merge drivers
*.bundle.* binary merge=tgui-merge-bundle
*.chunk.* binary merge=tgui-merge-bundle
343 changes: 199 additions & 144 deletions .github/CONTRIBUTING.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ contact_links:
about: Запросы новых фич следует оставлять на форуме ss13-трекер в дискорде.
- name: Exploit Reports
url: https://github.com/ss220club/Paradise-SS220/security
about: Критические баги, которые могут быть использованы со злыми намерениями следует оставлять по ссылке.
about: Критические баги, которые могут быть использованы со злыми намерениями, следует оставлять по ссылке.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/issue_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body:
id: version
attributes:
label: BYOND Version
description: "На какой версии BYOND встретился баг. (Если уверены, что не связано - можно пропустить.)"
description: "На какой версии BYOND встретился баг. (Если уверены, что не связано, можно пропустить)"

- type: textarea
id: description
Expand Down Expand Up @@ -61,7 +61,7 @@ body:
attributes:
label: Шаги для повторения проблемы.
description: Самая важная часть. Опишите ВСЁ, что вы делали, что бы встретиться с проблемой. (Обязательное поле)
placeholder: Find a chair, buckle yourself into it, be eaten by dragon.
placeholder: Нашел стул, сел, взорвался.
validations:
required: true

Expand All @@ -79,11 +79,11 @@ body:
attributes:
label: Дополнительная информация
description: Всё, что вы считаете важным/относящимся к проблеме.
placeholder: "Я думаю, что проблема начала появляться после этого PR https://github.com/ss220club/Paradise-SS220/pull/583"
placeholder: Я думаю, что проблема начала появляться после этого PR https://github.com/ss220club/Paradise-SS220/pull/583

- type: textarea
id: logs
attributes:
label: Связанные логи
description: Пожалуйста, предоставьте связанные логи или рантаймы, если имеете к ним доступ(Лучше цензурить IP адреса).
description: Пожалуйста, предоставьте связанные логи или рантаймы, если имеете к ним доступ. (Лучше цензурить IP-адреса)
render: DM
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sounddel: Удалил старый звук
imageadd: Добавил новую картинку
imagedel: Удалил старую картинку
spellcheck: Исправил опечатку
experiment: Добавил эксперементальную функцию
experiment: Добавил экспериментальную функцию
/:cl:

<!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы можете написать свой ник справа от первого :cl:, если хотите. Иначе будет использован ваш ник на ГитХабе. -->
Expand Down
54 changes: 27 additions & 27 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
"TGUI":
- 'tgui/**'
'TGUI':
- 'tgui/**'

"Звук":
- '**/*.ogg'
'Звук':
- '**/*.ogg'

"Изменение Карты":
- '**/*.dmm'
'Изменение Карты':
- '**/*.dmm'

"Инструменты":
- '.gihub/workflows/**'
- 'tools/**'
'Инструменты':
- '.gihub/workflows/**'
- 'tools/**'

"Керберос":
- '_maps/map_files220/delta/delta.dmm'
'Керберос':
- '_maps/map_files220/stations/deltastation.dmm'

"Кибериада":
- '_maps/map_files220/cyberiad/cyberiad.dmm'
'Кибериада':
- '_maps/map_files220/stations/boxstation.dmm'

"Цереброн":
- '_maps/map_files220/MetaStation/MetaStation.dmm'
'Цереброн':
- '_maps/map_files220/stations/metastation.dmm'

"НЕ МОДУЛЬНО":
- all: ['code/**']
'НЕ МОДУЛЬНО':
- all: ['code/**']

"Спрайты":
- '**/*.dmi'
'Спрайты':
- '**/*.dmi'

"Требуется изменение конфига":
- 'config/**'
'Требуется изменение конфига':
- 'config/**'

"Документация":
- '**/*.md'
'Документация':
- '**/*.md'

"Частичная модульность":
- all: ['code/**', modular_ss220/**]
'Частичная модульность':
- all: ['code/**', modular_ss220/**]

"SQL":
- 'SQL/**'
'SQL':
- 'SQL/**'
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,55 @@ on:
pull_request:
branches:
- master
merge_group:

jobs:
run_linters:
name: Run Linters
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Setup Cache
uses: actions/cache@v4
with:
path: $HOME/SpacemanDMM
key: ${{ runner.os }}-spacemandmm

- name: Install Tools
run: |
bash tools/ci/install_build_deps.sh
bash tools/ci/install_dreamchecker.sh
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: ./tgui/yarn.lock

- run: pip install -r tools/requirements.txt
- name: Run Linters
run: |
tools/ci/check_json.sh
tools/ci/build_tgui.sh
tgui/bin/tgui --ci
python tools/ci/check_grep2.py
python tools/ci/check_line_endings.py
python tools/ci/check_file_names.py
python tools/ci/unticked_files.py ${GITHUB_WORKSPACE}
python tools/ci/illegal_dme_files.py ${GITHUB_WORKSPACE}
python tools/ci/define_sanity.py
python -m tools.ci.check_icon_conflicts
python -m tools.ci.check_icon_dupenames
python -m tools.maplint.source --github
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Lints
uses: yogstation13/DreamAnnotate@v2
if: always()
with:
outputFile: output-annotations.txt
- name: Run DreamChecker
shell: bash
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh

odlint:
name: Lint with OpenDream
Expand Down Expand Up @@ -80,7 +91,7 @@ jobs:
strategy:
fail-fast: false # Let all map tests run to completion
matrix:
maptype: ['/datum/map/cyberiad', '/datum/map/delta', '/datum/map/metastation', '/datum/map/cerestation']
maptype: ['/datum/map/boxstation', '/datum/map/deltastation', '/datum/map/metastation', '/datum/map/cerestation']
byondtype: ['STABLE']
services:
mariadb:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/label_stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Label and close stale PRs and Issues

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day

jobs:
stale-prs:
runs-on: ubuntu-latest
steps:
- name: Seek and destroy stale PRs and Issues
uses: actions/stale@v9
with:
stale-pr-message: 'This pull request seems to be stale as there have been no changes in 14 days, please make changes within 7 days or the PR will be closed. If you believe this is a mistake, please inform a development team member on Discord.'
close-pr-message: 'This pull request has not received any updates since being marked stale, and as such is now being automatically closed. Please feel free to re-open this pull request or open a new one once you have new updates.'
stale-issue-message: 'This issue either requires verification or is unreproducible, but has had no updates for 60 days. Please provide an update within 14 days or this issue will be closed. If you believe this is a mistake, please contact an issue manager on Discord.'
close-issue-message: 'This issue was marked as stale, yet no changes have been observed in the specified time. The issue has been closed.'
days-before-stale: 14
days-before-issue-stale: 60
days-before-close: 7
days-before-issue-close: 14
exempt-issue-labels: '"Stale Exempt"'
exempt-pr-labels: '"Stale Exempt", "-Status: Awaiting approval", "-Status: Awaiting Merge", "-Status: Awaiting type assignment"'
any-of-issue-labels: '"Need Verification", "Cannot Reproduce", "Not A Bug", "(99% Sure) Not A Bug"'
115 changes: 115 additions & 0 deletions .github/workflows/merge_upstream_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Merge Upstream Master
on:
issue_comment:
types: created

jobs:
merge-upstream:
if: |
github.event.issue.pull_request &&
(github.event.comment.body == '!merge_upstream') &&
((github.event.sender.id == github.event.issue.user.id) ||
(github.event.comment.author_association == 'COLLABORATOR') ||
(github.event.comment.author_association == 'MEMBER') ||
(github.event.comment.author_association == 'OWNER'))
runs-on: ubuntu-latest
steps:
- id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- run: echo "GH_TOKEN=${{ steps.create_token.outputs.token }}" >> "$GITHUB_ENV"
- run: echo "FAIL_NOTIFIED=false" >> "$GITHUB_ENV"

- name: Like the comment
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/ParadiseSS13/Paradise/issues/comments/${{ github.event.comment.id }}/reactions \
-f content='+1'
- name: PR Data
run: |
pr_json=$(curl -L -s --fail-with-body -H "Authorization: token ${{ github.token }}" ${{ github.event.issue.pull_request.url }})
if [ `jq -r '.maintainer_can_modify' <<<$pr_json` == "false" ] ; then
gh pr comment ${{ github.event.issue.html_url }} --body 'GitHub Actions can not push to the repository without "Allow edits and access to secrets by maintainers" checked.'
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
echo "PR_REPO=`jq -r '.head.repo.full_name' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_BRANCH=`jq -r '.head.ref' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_HEAD_LABEL=`jq -r '.head.label' <<<$pr_json`" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ env.PR_REPO }}
ref: ${{ env.PR_BRANCH }}
token: ${{ env.GH_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: ./tgui/yarn.lock

- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Perform Merge
env:
BASE_BRANCH: ${{ github.event.repository.default_branch }}
BASE_REPOSITORY: ${{ github.repository }}
run: |
# Compare head branch and base branch
compare_result=$(curl -L -s --fail-with-body \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$BASE_REPOSITORY/compare/$BASE_BRANCH...$PR_HEAD_LABEL")
# Assign multiple variables with one jq execution
if IFS=$'\n' read -d '' -r behind_by ahead_by <<<$(jq '.behind_by, .ahead_by' <<<$compare_result) ; [ -z "$behind_by" ] || [ -z "$ahead_by" ] ; then
echo '- Unable to determine the distance between the head branch and the base branch.' | tee -a "$GITHUB_STEP_SUMMARY"
exit 1
fi
if [ "$behind_by" -le 0 ] ; then
echo '- Skipping merge. Up-to-date with base branch.' | tee -a "$GITHUB_STEP_SUMMARY"
exit 0
else
echo '- Merging base branch. Head branch is behind by '"$behind_by"' commits and ahead by '"$ahead_by"' commits.' | tee -a "$GITHUB_STEP_SUMMARY"
fi
# Install Tools
chmod +x tools/bootstrap/python
bash tools/hooks/install.sh
bash tgui/bin/tgui --install-git-hooks
chmod +x tools/hooks/*.merge tgui/bin/tgui
# Actual Merge
git config user.name paradisess13[bot]
git config user.email "165046124+paradisess13[bot]@users.noreply.github.com"
git remote add upstream "https://github.com/$BASE_REPOSITORY.git"
git fetch origin "$PR_BRANCH" --depth=$((ahead_by + 1))
git fetch upstream "$BASE_BRANCH" --depth=$((behind_by + 1))
# Check if a workflow file would be modified by the merge (permissions prevent pushes if so)
latest_workflow_commit=$(git log -n 1 --pretty=format:"%H" upstream/$BASE_BRANCH -- .github/workflows)
if ! git branch --contains $latest_workflow_commit | grep -q "$(git rev-parse --abbrev-ref HEAD)"; then
gh pr comment ${{ github.event.issue.html_url }} --body "GitHub Actions can not push to this branch as workflow files have been changed since your branch was last updated. Please update your branch past https://github.com/ParadiseSS13/Paradise/commit/$latest_workflow_commit before using this command again."#
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
git merge FETCH_HEAD
git push origin
- name: Notify Failure
if: failure() && env.FAIL_NOTIFIED != 'true'
run: |
gh pr comment ${{ github.event.issue.html_url }} -b 'Merging upstream failed, see the action run log for details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
29 changes: 12 additions & 17 deletions .github/workflows/render_nanomaps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ on:
- cron: "0 0 * * *"
workflow_dispatch:

permissions:
contents: read

jobs:
generate_maps:
permissions:
contents: write # for Git to git push
pull-requests: write # for repo-sync/pull-request to create pull requests
name: 'Generate NanoMaps'
runs-on: ubuntu-22.04
steps:
- id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- run: echo "GH_TOKEN=${{ steps.create_token.outputs.token }}" >> "$GITHUB_ENV"

- name: 'Update Branch'
uses: actions/checkout@v4
with:
token: ${{ steps.create_token.outputs.token }}

- name: Branch
run: |
Expand All @@ -32,20 +36,11 @@ jobs:
- name: 'Generate Maps'
run: './tools/github-actions/nanomap-renderer-invoker.sh'

- name: 'Commit Maps'
- name: 'Commit Maps and open PR'
run: |
git config --local user.email "[email protected]"
git config --local user.name "NanoMap Generation"
git pull origin master
git commit -m "NanoMap Auto-Update (`date`)" -a || true
git push -f -u origin nanomap-render
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: "nanomap-render"
destination_branch: "master"
pr_title: "Automatic NanoMap Update"
pr_body: "This pull request updates the server NanoMaps. Please review the diff images before merging."
pr_label: "NanoMaps"
pr_allow_empty: false
gh pr create -t "Automatic NanoMap Update" -b "This pull request updates the server NanoMaps. Please review the diff images before merging." -l "NanoMaps" -H "nanomap-render" -B "master"
Loading

0 comments on commit 324f9f7

Please sign in to comment.