Skip to content

Commit 3189640

Browse files
committed
Merge branch 'dev' into autoAttributeRatio
2 parents c03f8d7 + a8f8866 commit 3189640

File tree

135 files changed

+46706
-28875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+46706
-28875
lines changed

.github/tweak_changelogs.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
RELEASE_VERSION="$1"
4+
5+
# Delete until and including the first line containing "<!-- Release notes generated"
6+
sed -i '1,/^<!-- Release notes generated/d' temp_change.md
7+
8+
# Check if there is more than one non-empty line (the full changelog line) before we continue
9+
if [ $(grep -c '^[[:space:]]*[^[:space:]]' temp_change.md) -le 1 ]; then
10+
echo "No changes to release $RELEASE_VERSION"
11+
rm temp_change.md
12+
exit 1
13+
fi
14+
15+
# Remove all CR characters from all changelog files
16+
sed -i 's/\r//g' temp_change.md CHANGELOG.md changelog.txt
17+
18+
# Reverse the order of lines in the file (last line becomes first, etc.)
19+
sed -i '1h;1d;$!H;$!d;G' temp_change.md
20+
# Convert "**Full Changelog**: URL" format to markdown link format "[Full Changelog](URL)"
21+
sed -i -re 's/\*\*Full Changelog\*\*: (.*)/\[Full Changelog\]\(\1\)\n/' temp_change.md
22+
# Delete everything from "## New Contributors" line to the end of file
23+
sed -i '/## New Contributors/,$d' temp_change.md
24+
# Convert GitHub changelog entries to markdown format
25+
# "* description by (@username1, @username2) in #1310, #1311" → "- description #1310, #1311 (@username1, @username2)"
26+
sed -i -re 's/^\*\s(.*)\sby\s\(?(@[^)]*[^) ])\)?\s+in\s+(.*)/- \1 \3 (\2)/' temp_change.md
27+
# Convert @usernames to github links
28+
# "(@username1, @username2)" → "([username1](https://github.com/username1), [username2](https://github.com/username2))"
29+
sed -i -re 's/@([a-zA-Z0-9_-]+)/[\1](https:\/\/github.com\/\1)/g' temp_change.md
30+
# Convert full PR URLs to linked format
31+
# "https://github.com/repo/pull/1310" → "[\#1310](https://github.com/repo/pull/1310)"
32+
sed -i -re 's/(https:\/\/[^) ]*\/pull\/([0-9]+))/[\\#\2](\1)/g' temp_change.md
33+
34+
# Username substitutions for preferred display names
35+
sed -i 's/\[Quotae/\[Quote_a/' temp_change.md
36+
sed -i 's/\[learn2draw/\[Lexy/' temp_change.md
37+
sed -i 's/\[Voronoff/\[Tom Clancy Is Dead/' temp_change.md
38+
sed -i 's/\[PJacek/\[TPlant/' temp_change.md
39+
sed -i 's/\[justjuangui/\[trompetin17/' temp_change.md
40+
41+
cp temp_change.md changelog_temp.txt
42+
# Append existing CHANGELOG.md content (excluding first line) to temp_change.md
43+
cat CHANGELOG.md | sed '1d' >> temp_change.md
44+
# Create new CHANGELOG.md with header containing version and date, followed by processed changes
45+
printf "# Changelog\n\n## [$RELEASE_VERSION](https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/tree/$RELEASE_VERSION) ($(date +'%Y/%m/%d'))\n\n" | cat - temp_change.md > CHANGELOG.md
46+
# Convert changelog entries from markdown link format to simplified "* description (username)" format
47+
# First remove all PR links
48+
sed -i -re 's/( \()?\[\\#[0-9]+\]\([^)]*\),? ?\)?//g' changelog_temp.txt
49+
# Remove markdown link formatting from usernames in parentheses
50+
sed -i -re 's/\[([^]]*)\]\(https:\/\/github\.com\/[^)]*\)/\1/g' changelog_temp.txt
51+
# Create new changelog format: add version header, remove lines 2-3, format section headers, remove ## headers with following line, prepend to existing changelog
52+
echo "VERSION[${RELEASE_VERSION#v}][$(date +'%Y/%m/%d')]" | cat - changelog_temp.txt | sed '2,3d' | sed -re 's/^### (.*)/\n--- \1 ---/' | sed -e '/^##.*/,+1 d' | cat - changelog.txt > changelog_new.txt
53+
mv changelog_new.txt changelog.txt
54+
55+
# Normalize line endings to CRLF for all output files to ensure consistent checksums with Windows
56+
sed -i 's/\r*$/\r/' CHANGELOG.md changelog.txt
57+
58+
# Clean up temporary files
59+
rm temp_change.md
60+
rm changelog_temp.txt

.github/workflows/beta.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,36 @@ jobs:
1616
uses: actions/checkout@v3
1717
with:
1818
ref: 'dev'
19+
fetch-depth: 0
1920
- name: Configure bot user
2021
run: |
2122
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
2223
git config --global user.name "github-actions[bot]"
24+
- name: Generate Release notes
25+
run: |
26+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
27+
# Delete existing beta draft if it exists
28+
if gh release view beta >/dev/null 2>&1; then
29+
gh release delete beta --yes
30+
fi
31+
# Create new beta draft release with generated notes
32+
# Make sure the latest tag is correct, even if the current commit is already tagged
33+
LATEST_TAG=$(git describe --tags --abbrev=0)
34+
gh release create beta --title "Beta Release" --draft --generate-notes --notes-start-tag "$LATEST_TAG"
35+
gh release view beta > temp_change.md
36+
- name: Tweak changelogs
37+
id: tweak-changelogs
38+
continue-on-error: true
39+
run: |
40+
# Remove carriage returns to be able to run the script
41+
sed -i 's/\r$//' .github/tweak_changelogs.sh
42+
chmod +x .github/tweak_changelogs.sh
43+
.github/tweak_changelogs.sh beta
44+
# The hash suffix will help identifying if the beta version is up-to-date
45+
- name: Add commit hash suffix to manifest version
46+
if: steps.tweak-changelogs.outcome == 'success'
47+
run: |
48+
sed -i "s/<Version number=\"\([^\"]*\)\"/<Version number=\"\1-$(git rev-parse --short HEAD)\"/g" manifest.xml
2349
- name: Update manifest.xml
2450
run: python3 update_manifest.py --quiet --in-place
2551
- name: Push to beta branch

.github/workflows/installer.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
release:
44
types: [published]
55
workflow_dispatch:
6+
inputs:
7+
tag_name:
8+
description: 'Tag to build'
9+
required: true
10+
default: 'v0.x.x'
611
env:
712
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
813
jobs:
@@ -15,9 +20,12 @@ jobs:
1520
repository: 'PathOfBuildingCommunity/PathOfBuilding-Installer'
1621
ref: 'master'
1722
ssh-key: '${{ secrets.POB_INSTALLER_KEY }}'
23+
- name: Install NSIS
24+
run: |
25+
choco install nsis --yes
26+
echo "C:\Program Files (x86)\NSIS" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
1827
- name: Create installer
1928
run: 'python3 make_release.py --game-version 2'
2029
- name: Upload artifact
2130
run: >
22-
gh release upload ${{ github.event.release.tag_name }} (Get-ChildItem Dist -File).FullName --clobber -R ${{ github.repository }};
23-
31+
gh release upload ${{ github.event.release.tag_name || github.event.inputs.tag_name }} (Get-ChildItem Dist -File).FullName --clobber -R ${{ github.repository }};

.github/workflows/release.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
releaseVersion:
77
description: 'Version number to use for this release'
88
required: true
9-
default: '2.x.x'
9+
default: '0.x.x'
1010
releaseNoteUrl:
1111
description: 'Enter the location of edited release notes to use'
1212
required: false
@@ -29,27 +29,11 @@ jobs:
2929
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token;
3030
gh release view $(basename ${{ github.event.inputs.releaseNoteUrl }}) > temp_change.md
3131
- name: Tweak changelogs
32-
run: >
33-
sed -i '1,10d' temp_change.md;
34-
sed -i '1h;1d;$!H;$!d;G' temp_change.md;
35-
sed -i -re 's/\*\*Full Changelog\*\*: (.*)/\[Full Changelog\]\(\1\)\n/' temp_change.md;
36-
sed -i '/## New Contributors/,$d' temp_change.md;
37-
sed -i -re 's/^\*(.*)\sby\s@(.*)\sin\s(.*\/pull\/)(.*)\r?/-\1 [\\#\4](\3\4) ([\2](https:\/\/github.com\/\2))/' temp_change.md;
38-
sed -i 's/\[Quotae/\[Quote_a/' temp_change.md;
39-
sed -i 's/\[learn2draw/\[Lexy/' temp_change.md;
40-
sed -i 's/\[Voronoff/\[Tom Clancy Is Dead/' temp_change.md;
41-
sed -i 's/\[PJacek/\[TPlant/' temp_change.md;
42-
sed -i 's/\[justjuangui/\[trompetin17/' temp_change.md;
43-
sed -i 's/\r//g' temp_change.md;
44-
cp temp_change.md changelog_temp.txt;
45-
cat CHANGELOG.md | tr \\r \\n | sed '1d' >> temp_change.md;
46-
printf "# Changelog\n\n## [v${{ github.event.inputs.releaseVersion }}](https://github.com/PathOfBuildingCommunity/PathOfBuilding/tree/v${{ github.event.inputs.releaseVersion }}) ($(date +'%Y/%m/%d'))\n\n" | cat - temp_change.md > CHANGELOG.md;
47-
48-
sed -i -re 's/^- (.*) \[.*\) \(\[(.*)\]\(.*/* \1 (\2)/' changelog_temp.txt;
49-
echo "VERSION[${{ github.event.inputs.releaseVersion }}][`date +'%Y/%m/%d'`]" | cat - changelog_temp.txt | tr -d \\r | sed '2,3d' | sed -re 's/^### (.*)/\n--- \1 ---/' | sed -e '/^##.*/,+1 d' | cat - changelog.txt > changelog_new.txt;
50-
rm temp_change.md;
51-
rm changelog_temp.txt;
52-
mv changelog_new.txt changelog.txt
32+
run: |
33+
# Remove carriage returns to be able to run the script
34+
sed -i 's/\r$//' .github/tweak_changelogs.sh
35+
chmod +x .github/tweak_changelogs.sh
36+
.github/tweak_changelogs.sh "v${{ github.event.inputs.releaseVersion }}"
5337
- name: Create Pull Request
5438
uses: peter-evans/create-pull-request@v5
5539
with:

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,21 @@ jobs:
1515
- name: Run tests
1616
run: busted --lua=luajit
1717
- name: Report coverage
18+
continue-on-error: true # May fail on server errors (of coveralls.io)
1819
run: cd src; luacov-coveralls --repo-token=${{ secrets.github_token }} -e TestData -e Data -e runtime
20+
check_modcache:
21+
runs-on: ubuntu-latest
22+
container: ghcr.io/pathofbuildingcommunity/pathofbuilding-tests:latest
23+
steps:
24+
- name: Install git dependency
25+
run: apk add git
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Regenerate ModCache
29+
env:
30+
LUA_PATH: ../runtime/lua/?.lua;../runtime/lua/?/init.lua
31+
REGENERATE_MOD_CACHE: 1
32+
run: cd src; luajit HeadlessWrapper.lua
33+
- run: git config --global --add safe.directory $(pwd)
34+
- name: Check if the generated ModCache is different
35+
run: git diff --exit-code src/Data/ModCache.lua

0 commit comments

Comments
 (0)