Skip to content

Commit aa13e83

Browse files
committed
1 parent fe24eda commit aa13e83

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

.github/workflows/beta.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ jobs:
2020
run: |
2121
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
2222
git config --global user.name "github-actions[bot]"
23+
# The hash suffix will help identifying if the beta version is up-to-date
24+
- name: Add commit hash suffix to manifest version
25+
run: |
26+
sed -i "s/<Version number=\"\([^\"]*\)\"/<Version number=\"\1-$(git rev-parse --short HEAD)\"/g" manifest.xml
27+
- name: Generate Release notes
28+
run: |
29+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
30+
# Delete existing beta draft if it exists
31+
if gh release view beta >/dev/null 2>&1; then
32+
gh release delete beta --yes
33+
fi
34+
# Create new beta draft release with generated notes
35+
gh release create beta --title "Beta Release" --draft --generate-notes
36+
gh release view beta > temp_change.md
37+
- name: Tweak changelogs
38+
run: |
39+
# Remove carriage returns to be able to run the script
40+
sed -i 's/\r$//' .github/tweak_changelogs.sh
41+
chmod +x .github/tweak_changelogs.sh
42+
.github/tweak_changelogs.sh beta
2343
- name: Update manifest.xml
2444
run: python3 update_manifest.py --quiet --in-place
2545
- name: Push to beta branch

.github/workflows/release.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

0 commit comments

Comments
 (0)