-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 changelog merging across MC versions #19
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
26982ca
Fix changelog merging through MC versions
Thodor12 69202bb
Merge branch 'ng7' into fix/changelog-merging
Thodor12 b03dd79
Tagging per version
Thodor12 8ef4c9b
Updates to build system
Thodor12 0240ce4
Merge branch 'ng7' into fix/changelog-merging
Thodor12 284f8e0
Even more logic into the version action
Thodor12 04c6c12
Fix name
Thodor12 cb04bb2
Fix var naming
Thodor12 83d2d13
Fix
Thodor12 0c87375
Fix sed command
Thodor12 fa854bc
Fix sed command
Thodor12 514e251
Fetch less
Thodor12 cf4431a
Print without new lines and another \
Thodor12 5904b9e
Fix wrong variables
Thodor12 47f5b0b
Fixes
Thodor12 accc179
Disable discord temporarily
Thodor12 04a5257
Remove all vars
Thodor12 056f37e
Encryption key not required
Thodor12 2ef986b
Quote arguments
Thodor12 70064e6
Output the changelog
Thodor12 f7054f6
Fix output misdefined
Thodor12 76b3c98
Re-enable all steps
Thodor12 6c745fe
Add github token
Thodor12 539bf7a
Rename
Thodor12 c054df3
Undo
Thodor12 5277129
Add due tag
Thodor12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,8 +44,29 @@ permissions: | |
statuses: write | ||
|
||
jobs: | ||
generate-release-information: | ||
name: "Generate release information" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_version_suffix: ${{ steps.generateReleaseSuffix.outputs.release_version_suffix }} | ||
steps: | ||
- id: generateReleaseSuffix | ||
name: "Generate release suffix" | ||
run: | | ||
release_version_suffix="alpha" | ||
if [[ ${{ inputs.curse_release_type }} == release ]]; then | ||
release_version_suffix="" | ||
elif [[ ${{ inputs.curse_release_type }} == beta ]]; then | ||
release_version_suffix="snapshot" | ||
fi | ||
echo "Release version suffix: ${release_version_suffix}" | ||
echo "release_version_suffix=${release_version_suffix}" >> "$GITHUB_OUTPUT" | ||
|
||
compute-version: | ||
needs: [ "generate-release-information" ] | ||
uses: ./.github/workflows/gradle.version.yaml | ||
with: | ||
suffix: ${{ needs.generate-release-information.outputs.release_version_suffix }} | ||
|
||
notify-build-start: | ||
needs: [ "compute-version" ] | ||
|
@@ -57,7 +78,7 @@ jobs: | |
with: | ||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: 'started' | ||
version: "${{ needs.compute-version.outputs.version }}" | ||
version: "${{ needs.compute-version.outputs.full_version }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -67,7 +88,7 @@ jobs: | |
authToken: ${{secrets.GITHUB_TOKEN}} | ||
context: 'Publishing' | ||
state: 'pending' | ||
description: "Version: ${{ needs.compute-version.outputs.version }}" | ||
description: ${{ needs.compute-version.outputs.release_text }} | ||
target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
|
||
gradle: | ||
|
@@ -99,33 +120,23 @@ jobs: | |
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git tag -a ${{ needs.compute-version.outputs.version }} -m "Version ${{ needs.compute-version.outputs.version }}" | ||
git tag -a "${{ needs.compute-version.outputs.tag_version }}" -m "${{ needs.compute-version.outputs.release_text }}" | ||
|
||
- id: generate-release-changelog | ||
- id: generateReleaseChangelog | ||
name: "📝 Generate release changelog" | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
output: changelog.md | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
stripGeneratorNotice: "true" | ||
onlyLastTag: true | ||
dueTag: ${{ needs.compute-version.outputs.tag_version }} | ||
excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} | ||
maxIssues: ${{ inputs.changelog_max_issues }} | ||
|
||
- id: generate-release-suffix | ||
name: "Generate release suffix" | ||
run: | | ||
release_version_suffix="alpha" | ||
if [[ ${{ inputs.curse_release_type }} == release ]]; then | ||
release_version_suffix="" | ||
elif [[ ${{ inputs.curse_release_type }} == beta ]]; then | ||
release_version_suffix="snapshot" | ||
fi | ||
echo "Release version suffix: ${release_version_suffix}" | ||
echo "release_version_suffix=${release_version_suffix}" >> "$GITHUB_OUTPUT" | ||
|
||
- id: publish | ||
name: "🚀 Publish" | ||
run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ steps.generate-release-suffix.outputs.release_version_suffix }} | ||
run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.mod_version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} | ||
env: | ||
LDTTeamJfrogUsername: ${{ secrets.MAVEN_USER }} | ||
LDTTeamJfrogPassword: ${{ secrets.MAVEN_PASSWORD }} | ||
|
@@ -138,14 +149,14 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.compute-version.outputs.version }} | ||
release_name: "Release ${{ needs.compute-version.outputs.version }}" | ||
tag_name: ${{ needs.compute-version.outputs.tag_version }} | ||
release_name: ${{ needs.compute-version.outputs.release_text }} | ||
body_path: changelog.md | ||
prerelease: ${{ inputs.curse_release_type != 'release' }} | ||
|
||
notify-build-end: | ||
name: Build notifications (end) | ||
needs: [ "compute-version", "notify-build-start", "gradle" ] | ||
name: "🔴 Build notifications (end)" | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -154,7 +165,7 @@ jobs: | |
with: | ||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: ${{ needs.gradle.result }} | ||
version: "${{ needs.compute-version.outputs.version }}" | ||
version: "${{ needs.compute-version.outputs.full_version }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: neoforged/action-github-status@v1 | ||
|
@@ -163,5 +174,5 @@ jobs: | |
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
context: 'Publishing' | ||
state: ${{ needs.gradle.result }} | ||
description: "Version: ${{ needs.compute-version.outputs.version }}" | ||
description: ${{ needs.compute-version.outputs.release_text }} | ||
target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,32 @@ name: Common Version Determination CI | |
|
||
on: | ||
workflow_call: | ||
inputs: | ||
suffix: | ||
description: "The release suffix" | ||
type: string | ||
outputs: | ||
version: | ||
description: "The computed version" | ||
value: ${{ jobs.compute-version.outputs.version }} | ||
minecraft_version: | ||
description: "The minecraft version" | ||
value: ${{ jobs.compute-version.outputs.minecraft_version }} | ||
mod_version: | ||
description: "The mod version" | ||
value: ${{ jobs.compute-version.outputs.mod_version }} | ||
suffix: | ||
description: "The input suffix" | ||
value: ${{ inputs.suffix }} | ||
full_version: | ||
description: "The full version string" | ||
value: ${{ jobs.compute-version.outputs.full_version }} | ||
tag_version: | ||
description: "The version that the tag should get" | ||
value: ${{ jobs.compute-version.outputs.tag_version }} | ||
tag_regex: | ||
description: "The regex for matching identical version tags" | ||
value: ${{ jobs.compute-version.outputs.tag_regex }} | ||
release_text: | ||
description: "The text for the release version" | ||
value: ${{ jobs.compute-version.outputs.release_text }} | ||
|
||
permissions: | ||
contents: read | ||
|
@@ -14,21 +36,63 @@ jobs: | |
compute-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
minecraft_version: ${{ steps.generateMinecraftVersion.outputs.minecraft_version }} | ||
mod_version: ${{ steps.generateModVersion.outputs.version }} | ||
full_version: ${{ steps.generateFullVersion.outputs.full_version }} | ||
tag_version: ${{ steps.generateTagVersion.outputs.tag_version }} | ||
tag_regex: ${{ steps.generateTagRegex.outputs.tag_regex }} | ||
release_text: ${{ steps.generateReleaseText.outputs.release_text }} | ||
steps: | ||
- id: checkout | ||
name: "📦 Checkout" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-depth: 1000 | ||
fetch-tags: true | ||
|
||
- id: version | ||
name: "🔢 Compute version" | ||
- id: generateMinecraftVersion | ||
name: "Generate Minecraft version" | ||
run: | | ||
cat gradle.properties | grep exactMinecraftVersion | cut -d "=" -f 2 > minecraft_version.txt | ||
echo "Minecraft version: $(cat minecraft_version.txt)" | ||
echo "minecraft_version=$(cat minecraft_version.txt)" >> "$GITHUB_OUTPUT" | ||
|
||
- id: generateModVersion | ||
name: "Generate mod version" | ||
uses: PaulHatch/[email protected] | ||
with: | ||
tag_prefix: "v" | ||
tag_prefix: "v${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-" | ||
search_commit_body: true | ||
debug: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need debug for this? isnt that linked to running action in debug mode? |
||
bump_each_commit: true | ||
version_format: "${major}.${minor}.${patch}" | ||
version_format: "${major}.${minor}.${patch}" | ||
|
||
- id: generateFullVersion | ||
name: "Generate full version" | ||
run: | | ||
full_version="${{ steps.generateModVersion.outputs.version }}-${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-${{ inputs.suffix }}" | ||
echo "Full version: ${full_version}" | ||
echo "full_version=${full_version}" >> "$GITHUB_OUTPUT" | ||
|
||
- id: generateTagVersion | ||
name: "Generate tag version" | ||
run: | | ||
tag_version="v${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-${{ steps.generateModVersion.outputs.version }}" | ||
echo "Tag version: ${tag_version}" | ||
echo "tag_version=${tag_version}" >> "$GITHUB_OUTPUT" | ||
|
||
- id: generateTagRegex | ||
name: "Generate tag version regex" | ||
run: | | ||
echo -n "^(?!v" > tag_regex.txt | ||
echo -n "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed "s|\.|\\\\.|g" >> tag_regex.txt | ||
echo -n ").+$" >> tag_regex.txt | ||
echo "Tag version regex: $(cat tag_regex.txt)" | ||
echo "tag_regex=$(cat tag_regex.txt)" >> "$GITHUB_ENV" | ||
|
||
- id: generateReleaseText | ||
name: "Generate release text" | ||
run: | | ||
release_text="Version ${{ steps.generateModVersion.outputs.version }} for Minecraft ${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | ||
echo "Release text: ${release_text}" | ||
echo "release_text=${release_text}" >> "$GITHUB_OUTPUT" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At Orion: i think we can lower this something more sensible like 100? (not sure where 1k comes from, but iirc neo has changelog generation since fixed version so that's why)