Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #18

Merged
merged 13 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 6 additions & 67 deletions .github/workflows/auto-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,78 +18,17 @@ jobs:
with:
python-version: '3.x'

- name: Install PyYAML
run: pip install pyyaml
- name: Install Dependencies
run: |
pip install pyyaml
pip install PyGithub

- name: Parse PR and Update Changelog
env:
CHANGELOG_FILE_PATH: 'Resources/Changelog/ChangelogStarlight.yml'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
import os
import yaml
import re
from datetime import datetime
from github import Github

changelog_path = os.getenv("CHANGELOG_FILE_PATH")
pr_number = os.getenv("GITHUB_REF").split('/')[-1]
repo_name = os.getenv("GITHUB_REPOSITORY")
github_token = os.getenv("GITHUB_TOKEN")

g = Github(github_token)
repo = g.get_repo(repo_name)
pr = repo.get_pull(int(pr_number))

def parse_changelog(pr_body):
changelog_entries = []
pattern = r":cl: (.+?)\\n((?:- (add|remove|tweak|fix): .+\\n)+)"
matches = re.finditer(pattern, pr_body, re.MULTILINE)

for match in matches:
author = match.group(1).strip()
changes = match.group(2).strip().splitlines()

for change in changes:
change_type, message = change.split(":", 1)
changelog_entries.append({
"author": author,
"type": change_type.strip('- ').capitalize(),
"message": message.strip()
})
return changelog_entries

def get_last_id(changelog_data):
if not changelog_data or "Entries" not in changelog_data or not changelog_data["Entries"]:
return 0
return max(entry["id"] for entry in changelog_data["Entries"])

if ":cl:" in pr.body:
merge_time = pr.merged_at
entries = parse_changelog(pr.body)

if os.path.exists(changelog_path):
with open(changelog_path, "r") as file:
changelog_data = yaml.safe_load(file) or {"Entries": []}
else:
changelog_data = {"Entries": []}

last_id = get_last_id(changelog_data)
for entry in entries:
last_id += 1
changelog_entry = {
"author": entry["author"],
"changes": [{
"message": entry["message"],
"type": entry["type"]
}],
"id": last_id,
"time": merge_time.isoformat()
}
changelog_data["Entries"].append(changelog_entry)

with open(changelog_path, "w") as file:
yaml.dump(changelog_data, file, allow_unicode=True)
PR_NUMBER: ${{ github.event.pull_request.number }}
run: python ./Tools/_Starlight/update_changelog.py

- name: Commit and push changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Weapons/Ranged/Components/GunComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public sealed partial class GunComponent : Component
/// How fast the projectile moves.
/// <seealso cref="GunRefreshModifiersEvent"/>
/// </summary>
[AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float ProjectileSpeedModified;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
objective-condition-other-traitor-progress-title = Ensure fellow traitor {$targetName}, {CAPITALIZE($job)} achieves at least half their objectives.
objective-condition-other-traitor-progress-title = Ensure fellow traitor {$targetName}, {CAPITALIZE($job)} achieves at least half their objectives.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/objectives/conditions/station.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
objective-no-owner-traitor-sliver-text = Cut off a sliver from the supermatter crystal.
objective-description-traitor-sliver-text = Use any cutting tool that comes in handy. A scalpel is more recommended. Also, don't die of radiation poisoning.
5 changes: 2 additions & 3 deletions Resources/Prototypes/Objectives/traitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,12 @@
# station's property

- type: entity
noSpawn: true
parent: BaseTraitorStealObjective
id: StealSupermatterSliverObjective
components:
- type: Objective
difficulty: 2.5
- type: StealCondition
stealGroup: SupermatterSliver
objectiveNoOwnerText: Cut off a sliver from the supermatter crystal.
descriptionText: Use any cutting tool that comes in handy. A scalpel is more recommended. Also, don't die of radiation poisoning.
objectiveNoOwnerText: objective-no-owner-traitor-sliver-text
descriptionText: objective-description-traitor-sliver-text
1 change: 0 additions & 1 deletion Resources/Prototypes/SoundCollections/lobby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id: LobbyMusic
files:
- /Audio/Lobby/thunderdome.ogg
- /Audio/Lobby/absconditus.ogg
- /Audio/Lobby/space_asshole.ogg
- /Audio/Lobby/endless_space.ogg
- /Audio/Lobby/singuloose.ogg
Expand Down
4 changes: 0 additions & 4 deletions Resources/Prototypes/_StarLight/Enemies/Abyss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
- type: Speech
speechVerb: LargeMob
- type: NoSlip
- type: NPCUseActionOnTarget
actionId: ActionMobBlink
- type: StatusEffects # Overwriting basesimplemob to remove flash, getting flashed as dragon just feelsbad
allowed:
- SlowedDown
Expand Down Expand Up @@ -147,8 +145,6 @@
tags:
- DoorBumpOpener
- type: NoSlip
- type: NPCUseActionOnTarget
actionId: ActionMobBlink
- type: StatusEffects # Overwriting basesimplemob to remove flash, getting flashed as dragon just feelsbad
allowed:
- SlowedDown
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- type: entity
name: EMP impulse
parent: BaseBulletTrigger
id: BulletEMP
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: Effects/emp.rsi
layers:
- state: emp_pulse
- type: EmpOnTrigger
range: 2
energyConsumption: 30000
disableDuration: 10
- type: Ammo
muzzleFlash: null
- type: PointLight
radius: 3.5
color: blue
energy: 0.5
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
EntranceFlank: SyndieDungeonWindow
Junction: BaseAirlock
WallMounts: SyndieDungeonWalls
Window: ReinforcedWindow
Window: SyndieDungeonWindow
tiles:
FallbackTile: FloorShuttleRed
whitelists:
Expand All @@ -182,7 +182,7 @@
EntranceFlank: SovietDungeonWindow
Junction: BaseAirlock
WallMounts: SovietDungeonWalls
Window: WindowRCDResistant
Window: SovietDungeonWindow
tiles:
FallbackTile: FloorConcreteMono
whitelists:
Expand Down
70 changes: 70 additions & 0 deletions Tools/_Starlight/update_changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import os
import yaml
import re
from datetime import datetime
from github import Github

# Параметры окружения
changelog_path = os.getenv("CHANGELOG_FILE_PATH")
pr_number = os.getenv("PR_NUMBER")
repo_name = os.getenv("GITHUB_REPOSITORY")
github_token = os.getenv("GITHUB_TOKEN")

# Инициализация GitHub API
g = Github(github_token)
repo = g.get_repo(repo_name)
pr = repo.get_pull(int(pr_number))

def parse_changelog(pr_body):
changelog_entries = []
pattern = r":cl: (.+?)\n((?:- (add|remove|tweak|fix): .+\n)+)"
matches = re.finditer(pattern, pr_body, re.MULTILINE)

for match in matches:
author = match.group(1).strip()
changes = match.group(2).strip().splitlines()

for change in changes:
change_type, message = change.split(":", 1)
changelog_entries.append({
"author": author,
"type": change_type.strip('- ').capitalize(),
"message": message.strip()
})
return changelog_entries

def get_last_id(changelog_data):
if not changelog_data or "Entries" not in changelog_data or not changelog_data["Entries"]:
return 0
return max(entry["id"] for entry in changelog_data["Entries"])

def update_changelog():
if ":cl:" in pr.body:
merge_time = pr.merged_at
entries = parse_changelog(pr.body)

if os.path.exists(changelog_path):
with open(changelog_path, "r") as file:
changelog_data = yaml.safe_load(file) or {"Entries": []}
else:
changelog_data = {"Entries": []}

last_id = get_last_id(changelog_data)
for entry in entries:
last_id += 1
changelog_entry = {
"author": entry["author"],
"changes": [{
"message": entry["message"],
"type": entry["type"]
}],
"id": last_id,
"time": merge_time.isoformat()
}
changelog_data["Entries"].append(changelog_entry)

with open(changelog_path, "w") as file:
yaml.dump(changelog_data, file, allow_unicode=True)

if __name__ == "__main__":
update_changelog()
Loading