From 26982cad5277d95c9305138587abd5cafb81f1be Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Sun, 25 Aug 2024 09:19:58 +0200 Subject: [PATCH 01/24] Fix changelog merging through MC versions --- .github/workflows/gradle.publish.yaml | 6 ++++++ .github/workflows/gradle.version.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index f6fb5c7..9c41dcc 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -101,6 +101,11 @@ jobs: git config --global user.email "maintainer+github@ldtteam.com" git tag -a ${{ needs.compute-version.outputs.version }} -m "Version ${{ needs.compute-version.outputs.version }}" + - id: generate-release-changelog-version-regex + name: "📝 Generate release changelog version regex" + run: | + echo "version_regex=$(echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g')" >> "$GITHUB_ENV" + - id: generate-release-changelog name: "📝 Generate release changelog" uses: heinrichreimer/action-github-changelog-generator@v2.4 @@ -109,6 +114,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} stripGeneratorNotice: "true" onlyLastTag: true + excludeTagsRegex: "^(?!v${{ steps.generate-release-changelog-version-regex.outputs.version_regex }}).+$" maxIssues: ${{ inputs.changelog_max_issues }} - id: get-mod-name diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index dbe8055..662e46c 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -38,7 +38,7 @@ jobs: name: "🔢 Compute version" uses: PaulHatch/semantic-version@v5.4.0 with: - tag_prefix: "v" + tag_prefix: "v${{ steps.minecraftVersion.outputs.minecraft_version }}" search_commit_body: true debug: true bump_each_commit: true From b03dd79537b226c66c09fb6301d9f1a97b3c1239 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 17:54:24 +0200 Subject: [PATCH 02/24] Tagging per version --- .github/workflows/gradle.publish.yaml | 10 ++++++---- .github/workflows/gradle.version.yaml | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index cce6fd9..8f91ce2 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -99,12 +99,14 @@ jobs: run: | git config --global user.name "GitHub Actions" git config --global user.email "maintainer+github@ldtteam.com" - git tag -a ${{ needs.compute-version.outputs.version }} -m "Version ${{ needs.compute-version.outputs.version }}" + git tag -a v${{ needs.compute_version.outputs.minecraft_version }}-${{ needs.compute-version.outputs.version }} -m "Version ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" - id: generate-release-changelog-version-regex name: "📝 Generate release changelog version regex" run: | - echo "version_regex=$(echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g')" >> "$GITHUB_ENV" + version_regex=${echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g'} + echo "Changelog version regex: ${version_regex}" + echo "version_regex=${version_regex}" >> "$GITHUB_ENV" - id: generate-release-changelog name: "📝 Generate release changelog" @@ -144,8 +146,8 @@ 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: v${{ needs.compute_version.outputs.minecraft_version }}-${{ needs.compute-version.outputs.version }} + release_name: "Release ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" body_path: changelog.md prerelease: ${{ inputs.curse_release_type != 'release' }} diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 6d9be42..55625bd 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -6,6 +6,9 @@ on: version: description: "The computed version" value: ${{ jobs.compute-version.outputs.version }} + minecraft_version: + description: "The minecraft version" + value: ${{ jobs.compute-version.outputs.minecraft_version }} permissions: contents: read @@ -15,6 +18,7 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} + minecraft_version: ${{ steps.minecraftVersion.outputs.minecraft_version }} steps: - id: checkout name: "📦 Checkout" @@ -22,6 +26,12 @@ jobs: with: fetch-depth: 0 fetch-tags: true + - id: minecraftVersion + name: "📦 Extract 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: version name: "🔢 Compute version" From 8ef4c9bab775e2357f6aae44504e13a89e70fbc5 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:22:01 +0200 Subject: [PATCH 03/24] Updates to build system --- .github/workflows/gradle.build.yaml | 36 +++++++++------ .github/workflows/gradle.prerelease.yaml | 4 +- .github/workflows/gradle.publish.yaml | 57 ++++++++++++++---------- .github/workflows/gradle.version.yaml | 44 +++++++++++++++--- 4 files changed, 96 insertions(+), 45 deletions(-) diff --git a/.github/workflows/gradle.build.yaml b/.github/workflows/gradle.build.yaml index 49303e8..9fccc20 100644 --- a/.github/workflows/gradle.build.yaml +++ b/.github/workflows/gradle.build.yaml @@ -23,11 +23,33 @@ permissions: contents: read jobs: + generate-build-information: + name: "Generate release information" + runs-on: ubuntu-latest + outputs: + branch_suffix: ${{ steps.computeBranchSuffix.outputs.branch_suffix }} + steps: + - id: computeBranchSuffix + name: "🔢 Compute branch suffix" + run: | + gitRef="${{ github.ref }}" + branchName=$(echo "${gitRef/refs\/heads\//}") + echo "Branch name: $branchName" + + cleanedBranchName=$(echo $branchName | sed 's/[^a-zA-Z0-9]/-/g') + echo "Cleaned branch name: $cleanedBranchName" + + echo "branch_suffix=$cleanedBranchName" >> "$GITHUB_OUTPUT" + compute-version: + needs: [ "generate-build-information" ] uses: ./.github/workflows/gradle.version.yaml + with: + suffix: ${{ needs.generate-build-information.outputs.branch_suffix }} build: needs: [ "compute-version" ] + name: "🏗️ Build" runs-on: ubuntu-latest steps: - id: checkout @@ -46,18 +68,6 @@ jobs: gradle-version: wrapper cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - - id: computeBranchSuffix - name: "🔢 Compute branch suffix" - run: | - gitRef="${{ github.ref }}" - branchName=$(echo "${gitRef/refs\/heads\//}") - echo "Branch name: $branchName" - - cleanedBranchName=$(echo $branchName | sed 's/[^a-zA-Z0-9]/-/g') - echo "Cleaned branch name: $cleanedBranchName" - - echo "branch_suffix=$cleanedBranchName" >> "$GITHUB_OUTPUT" - - id: build name: "🏗️ Build" - run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ steps.computeBranchSuffix.outputs.branch_suffix }} + run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ needs.compute_version.outputs.suffix }} diff --git a/.github/workflows/gradle.prerelease.yaml b/.github/workflows/gradle.prerelease.yaml index 6c9f4c7..3fb5d3e 100644 --- a/.github/workflows/gradle.prerelease.yaml +++ b/.github/workflows/gradle.prerelease.yaml @@ -29,6 +29,8 @@ permissions: jobs: compute-version: uses: ./.github/workflows/gradle.version.yaml + with: + suffix: rc gradle: needs: [ "compute-version" ] @@ -55,7 +57,7 @@ jobs: - id: build name: "🏗️ Build" - run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=rc + run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} env: GITHUB_TOKEN: ${{ github.token }} GITHUB_REPOSITORY: ${{ github.repository }} diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 8f91ce2..89a470b 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -44,11 +44,32 @@ 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" ] + needs: [ "generate-release-information" ] name: "🔴 Build notifications (start)" runs-on: ubuntu-latest steps: @@ -57,7 +78,7 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: 'started' - version: "${{ needs.compute-version.outputs.version }}" + version: "${{ needs.generate-release-information.outputs.full_version }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -67,11 +88,11 @@ jobs: authToken: ${{secrets.GITHUB_TOKEN}} context: 'Publishing' state: 'pending' - description: "Version: ${{ needs.compute-version.outputs.version }}" + description: "Version: ${{ needs.generate-release-information.outputs.full_version }}" target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} gradle: - needs: [ "compute-version" ] + needs: [ "generate-release-information", "compute-version" ] runs-on: ubuntu-latest steps: - id: checkout @@ -99,16 +120,16 @@ jobs: run: | git config --global user.name "GitHub Actions" git config --global user.email "maintainer+github@ldtteam.com" - git tag -a v${{ needs.compute_version.outputs.minecraft_version }}-${{ needs.compute-version.outputs.version }} -m "Version ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" + git tag -a v${{ needs.generate-release-information.outputs.full_version }} -m "Release ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" - - id: generate-release-changelog-version-regex + - id: generateReleaseChangelogVersionRegex name: "📝 Generate release changelog version regex" run: | version_regex=${echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g'} echo "Changelog version regex: ${version_regex}" echo "version_regex=${version_regex}" >> "$GITHUB_ENV" - - id: generate-release-changelog + - id: generateReleaseChangelog name: "📝 Generate release changelog" uses: heinrichreimer/action-github-changelog-generator@v2.4 with: @@ -116,24 +137,12 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} stripGeneratorNotice: "true" onlyLastTag: true - excludeTagsRegex: "^(?!v${{ steps.generate-release-changelog-version-regex.outputs.version_regex }}).+$" + excludeTagsRegex: "^(?!v${{ steps.generateReleaseChangelogVersionRegex.outputs.version_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_ENV" - - 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.version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} env: LDTTeamJfrogUsername: ${{ secrets.MAVEN_USER }} LDTTeamJfrogPassword: ${{ secrets.MAVEN_PASSWORD }} @@ -146,7 +155,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ needs.compute_version.outputs.minecraft_version }}-${{ needs.compute-version.outputs.version }} + tag_name: ${{ needs.compute-version.outputs.tag_version }} release_name: "Release ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" body_path: changelog.md prerelease: ${{ inputs.curse_release_type != 'release' }} @@ -162,7 +171,7 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: ${{ needs.gradle.result }} - version: "${{ needs.compute-version.outputs.version }}" + version: "${{ needs.generate-release-information.outputs.full_version }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: neoforged/action-github-status@v1 @@ -171,5 +180,5 @@ jobs: authToken: ${{ secrets.GITHUB_TOKEN }} context: 'Publishing' state: ${{ needs.gradle.result }} - description: "Version: ${{ needs.compute-version.outputs.version }}" + description: "Version: ${{ needs.generate-release-information.outputs.full_version }}" target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 55625bd..eab1285 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -2,13 +2,26 @@ 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.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 }} permissions: contents: read @@ -17,8 +30,10 @@ jobs: compute-version: runs-on: ubuntu-latest outputs: - version: ${{ steps.version.outputs.version }} minecraft_version: ${{ steps.minecraftVersion.outputs.minecraft_version }} + mod_version: ${{ steps.version.outputs.version }} + full_version: ${{ steps.fullVersion.outputs.full_version }} + tag_version: ${{ steps.tagVersion.outputs.tag_version }} steps: - id: checkout name: "📦 Checkout" @@ -26,6 +41,7 @@ jobs: with: fetch-depth: 0 fetch-tags: true + - id: minecraftVersion name: "📦 Extract Minecraft version" run: | @@ -33,12 +49,26 @@ jobs: echo "Minecraft version: $(cat minecraft_version.txt)" echo "minecraft_version=$(cat minecraft_version.txt)" >> "$GITHUB_OUTPUT" - - id: version + - id: modVersion name: "🔢 Compute version" uses: PaulHatch/semantic-version@v5.4.0 with: - tag_prefix: "v${{ steps.minecraftVersion.outputs.minecraft_version }}" + tag_prefix: "v${{ steps.minecraftVersion.outputs.minecraft_version }}-" search_commit_body: true debug: true bump_each_commit: true - version_format: "${major}.${minor}.${patch}" \ No newline at end of file + version_format: "${major}.${minor}.${patch}" + + - id: fullVersion + name: "Generate full version" + run: | + full_version="${{ steps.modVersion.outputs.version }}-${{ steps.minecraftVersion.outputs.minecraft_version }}-${{ inputs.suffix }}" + echo "Full version: ${full_version}" + echo "full_version=${full_version}" >> "$GITHUB_OUTPUT" + + - id: tagVersion + name: "Generate tag version" + run: | + tag_version="v${{ steps.minecraftVersion.outputs.minecraft_version }}-${{ steps.modVersion.outputs.version }}" + echo "Full version: ${full_version}" + echo "tag_version=${tag_version}" >> "$GITHUB_OUTPUT" \ No newline at end of file From 284f8e07a4ac982fdb709f144291d56e9e96281e Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:33:57 +0200 Subject: [PATCH 04/24] Even more logic into the version action --- .github/workflows/gradle.publish.yaml | 29 +++++++----------- .github/workflows/gradle.version.yaml | 43 ++++++++++++++++++++------- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 89a470b..c6a9ec0 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -69,7 +69,7 @@ jobs: suffix: ${{ needs.generate-release-information.outputs.release_version_suffix }} notify-build-start: - needs: [ "generate-release-information" ] + needs: [ "compute-version" ] name: "🔴 Build notifications (start)" runs-on: ubuntu-latest steps: @@ -78,7 +78,7 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: 'started' - version: "${{ needs.generate-release-information.outputs.full_version }}" + version: "${{ needs.compute-version.outputs.full_version }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -88,11 +88,11 @@ jobs: authToken: ${{secrets.GITHUB_TOKEN}} context: 'Publishing' state: 'pending' - description: "Version: ${{ needs.generate-release-information.outputs.full_version }}" + description: ${{ needs.compute-version.outputs.release_text }} target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} gradle: - needs: [ "generate-release-information", "compute-version" ] + needs: [ "compute-version" ] runs-on: ubuntu-latest steps: - id: checkout @@ -120,14 +120,7 @@ jobs: run: | git config --global user.name "GitHub Actions" git config --global user.email "maintainer+github@ldtteam.com" - git tag -a v${{ needs.generate-release-information.outputs.full_version }} -m "Release ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_version }}" - - - id: generateReleaseChangelogVersionRegex - name: "📝 Generate release changelog version regex" - run: | - version_regex=${echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g'} - echo "Changelog version regex: ${version_regex}" - echo "version_regex=${version_regex}" >> "$GITHUB_ENV" + git tag -a ${{ needs.compute-version.outputs.tag_version }} -m ${{ needs.compute-version.outputs.release_text }} - id: generateReleaseChangelog name: "📝 Generate release changelog" @@ -137,7 +130,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} stripGeneratorNotice: "true" onlyLastTag: true - excludeTagsRegex: "^(?!v${{ steps.generateReleaseChangelogVersionRegex.outputs.version_regex }}).+$" + excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} maxIssues: ${{ inputs.changelog_max_issues }} - id: publish @@ -146,8 +139,8 @@ jobs: env: LDTTeamJfrogUsername: ${{ secrets.MAVEN_USER }} LDTTeamJfrogPassword: ${{ secrets.MAVEN_PASSWORD }} - CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} - CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} +# CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} +# CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} crowdinKey: ${{ secrets.CROWDIN_API_KEY }} - name: "🚀 Create GitHub release" @@ -156,13 +149,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ needs.compute-version.outputs.tag_version }} - release_name: "Release ${{ needs.compute-version.outputs.version }} for Minecraft ${{ needs.compute_version.outputs.minecraft_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: @@ -180,5 +173,5 @@ jobs: authToken: ${{ secrets.GITHUB_TOKEN }} context: 'Publishing' state: ${{ needs.gradle.result }} - description: "Version: ${{ needs.generate-release-information.outputs.full_version }}" + description: ${{ needs.compute-version.outputs.release_text }} target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index eab1285..695cd14 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -22,6 +22,12 @@ on: 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 @@ -30,10 +36,12 @@ jobs: compute-version: runs-on: ubuntu-latest outputs: - minecraft_version: ${{ steps.minecraftVersion.outputs.minecraft_version }} - mod_version: ${{ steps.version.outputs.version }} - full_version: ${{ steps.fullVersion.outputs.full_version }} - tag_version: ${{ steps.tagVersion.outputs.tag_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" @@ -42,14 +50,14 @@ jobs: fetch-depth: 0 fetch-tags: true - - id: minecraftVersion + - id: generateMinecraftVersion name: "📦 Extract 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: modVersion + - id: generateModVersion name: "🔢 Compute version" uses: PaulHatch/semantic-version@v5.4.0 with: @@ -59,16 +67,31 @@ jobs: bump_each_commit: true version_format: "${major}.${minor}.${patch}" - - id: fullVersion + - id: generateFullVersion name: "Generate full version" run: | full_version="${{ steps.modVersion.outputs.version }}-${{ steps.minecraftVersion.outputs.minecraft_version }}-${{ inputs.suffix }}" echo "Full version: ${full_version}" echo "full_version=${full_version}" >> "$GITHUB_OUTPUT" - - id: tagVersion + - id: generateTagVersion name: "Generate tag version" run: | tag_version="v${{ steps.minecraftVersion.outputs.minecraft_version }}-${{ steps.modVersion.outputs.version }}" - echo "Full version: ${full_version}" - echo "tag_version=${tag_version}" >> "$GITHUB_OUTPUT" \ No newline at end of file + echo "Tag version: ${tag_version}" + echo "tag_version=${tag_version}" >> "$GITHUB_OUTPUT" + + - id: generateTagRegex + name: "Generate tag version regex" + run: | + version_number=${echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g'} + tag_regex="^(?!v${version_number}).+$" + echo "Tag version regex: ${tag_regex}" + echo "tag_regex=${tag_regex}" >> "$GITHUB_ENV" + + - id: generateReleaseText + name: "Generate release text" + run: | + release_text="Version ${{ steps.version.outputs.version }} for Minecraft ${{ steps.minecraftVersion.outputs.minecraft_version }}" + echo "Release text: ${release_text}" + echo "release_text=${release_text}" >> "$GITHUB_OUTPUT" \ No newline at end of file From 04c6c12614c591283c113dadc68e4c36ccf1702a Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:34:39 +0200 Subject: [PATCH 05/24] Fix name --- .github/workflows/gradle.build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.build.yaml b/.github/workflows/gradle.build.yaml index 9fccc20..d83d07d 100644 --- a/.github/workflows/gradle.build.yaml +++ b/.github/workflows/gradle.build.yaml @@ -24,7 +24,7 @@ permissions: jobs: generate-build-information: - name: "Generate release information" + name: "Generate build information" runs-on: ubuntu-latest outputs: branch_suffix: ${{ steps.computeBranchSuffix.outputs.branch_suffix }} From cb04bb20b1061e20f772cf2779e77426df06e073 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:39:17 +0200 Subject: [PATCH 06/24] Fix var naming --- .github/workflows/gradle.version.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 695cd14..6294db4 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -58,10 +58,10 @@ jobs: echo "minecraft_version=$(cat minecraft_version.txt)" >> "$GITHUB_OUTPUT" - id: generateModVersion - name: "🔢 Compute version" + name: "🔢 Generate mod version" uses: PaulHatch/semantic-version@v5.4.0 with: - tag_prefix: "v${{ steps.minecraftVersion.outputs.minecraft_version }}-" + tag_prefix: "v${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-" search_commit_body: true debug: true bump_each_commit: true @@ -70,21 +70,21 @@ jobs: - id: generateFullVersion name: "Generate full version" run: | - full_version="${{ steps.modVersion.outputs.version }}-${{ steps.minecraftVersion.outputs.minecraft_version }}-${{ inputs.suffix }}" + full_version="${{ steps.modVersion.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.minecraftVersion.outputs.minecraft_version }}-${{ steps.modVersion.outputs.version }}" + 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: | - version_number=${echo "${{ needs.compute_version.outputs.minecraft_version }}" | sed 's/\./\\./g'} + version_number=${echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed 's/\./\\./g'} tag_regex="^(?!v${version_number}).+$" echo "Tag version regex: ${tag_regex}" echo "tag_regex=${tag_regex}" >> "$GITHUB_ENV" @@ -92,6 +92,6 @@ jobs: - id: generateReleaseText name: "Generate release text" run: | - release_text="Version ${{ steps.version.outputs.version }} for Minecraft ${{ steps.minecraftVersion.outputs.minecraft_version }}" + 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" \ No newline at end of file From 83d2d13c64540fc3b328916303c0e357b88bd4da Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:41:08 +0200 Subject: [PATCH 07/24] Fix --- .github/workflows/gradle.version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 6294db4..bf6476c 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -70,7 +70,7 @@ jobs: - id: generateFullVersion name: "Generate full version" run: | - full_version="${{ steps.modVersion.outputs.version }}-${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-${{ inputs.suffix }}" + 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" From 0c873750bb48d92cfb71df332af288f42fd52e71 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:44:26 +0200 Subject: [PATCH 08/24] Fix sed command --- .github/workflows/gradle.version.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index bf6476c..a1e0f09 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -84,8 +84,8 @@ jobs: - id: generateTagRegex name: "Generate tag version regex" run: | - version_number=${echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed 's/\./\\./g'} - tag_regex="^(?!v${version_number}).+$" + echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed "s|\.|\\\.|g" > tag_regex.txt + tag_regex="^(?!v${cat tag_regex.txt}).+$" echo "Tag version regex: ${tag_regex}" echo "tag_regex=${tag_regex}" >> "$GITHUB_ENV" From fa854bcee0c246e77fa8abcac3d00f3a0bb40366 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:47:47 +0200 Subject: [PATCH 09/24] Fix sed command --- .github/workflows/gradle.version.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index a1e0f09..6bc0cae 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -51,14 +51,14 @@ jobs: fetch-tags: true - id: generateMinecraftVersion - name: "📦 Extract Minecraft version" + 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" + name: "Generate mod version" uses: PaulHatch/semantic-version@v5.4.0 with: tag_prefix: "v${{ steps.generateMinecraftVersion.outputs.minecraft_version }}-" @@ -84,10 +84,11 @@ jobs: - id: generateTagRegex name: "Generate tag version regex" run: | - echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed "s|\.|\\\.|g" > tag_regex.txt - tag_regex="^(?!v${cat tag_regex.txt}).+$" - echo "Tag version regex: ${tag_regex}" - echo "tag_regex=${tag_regex}" >> "$GITHUB_ENV" + echo "^(?!v" > tag_regex.txt + echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed "s|\.|\\\.|g" >> tag_regex.txt + echo ").+$" >> 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" From 514e251a678b2be29690e0568e34d35fb2958e04 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:50:08 +0200 Subject: [PATCH 10/24] Fetch less --- .github/workflows/gradle.version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 6bc0cae..0fd03f3 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -47,7 +47,7 @@ jobs: name: "📦 Checkout" uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1000 fetch-tags: true - id: generateMinecraftVersion From cf4431ac3dceddab6c867f67373de871290d3bec Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:52:32 +0200 Subject: [PATCH 11/24] Print without new lines and another \ --- .github/workflows/gradle.version.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index 0fd03f3..ae60c65 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -84,9 +84,9 @@ jobs: - id: generateTagRegex name: "Generate tag version regex" run: | - echo "^(?!v" > tag_regex.txt - echo "${{ steps.generateMinecraftVersion.outputs.minecraft_version }}" | sed "s|\.|\\\.|g" >> tag_regex.txt - echo ").+$" >> tag_regex.txt + 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" From 5904b9e3f61227d5bfca6472909b104bd6230d7c Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 18:57:56 +0200 Subject: [PATCH 12/24] Fix wrong variables --- .github/workflows/gradle.build.yaml | 2 +- .github/workflows/gradle.prerelease.yaml | 2 +- .github/workflows/gradle.publish.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.build.yaml b/.github/workflows/gradle.build.yaml index d83d07d..2747de2 100644 --- a/.github/workflows/gradle.build.yaml +++ b/.github/workflows/gradle.build.yaml @@ -70,4 +70,4 @@ jobs: - id: build name: "🏗️ Build" - run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ needs.compute_version.outputs.suffix }} + run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.mod_version }} -PmodVersionSuffix=${{ needs.compute_version.outputs.suffix }} diff --git a/.github/workflows/gradle.prerelease.yaml b/.github/workflows/gradle.prerelease.yaml index 3fb5d3e..17ac73a 100644 --- a/.github/workflows/gradle.prerelease.yaml +++ b/.github/workflows/gradle.prerelease.yaml @@ -57,7 +57,7 @@ jobs: - id: build name: "🏗️ Build" - run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} + run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.mod_version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} env: GITHUB_TOKEN: ${{ github.token }} GITHUB_REPOSITORY: ${{ github.repository }} diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index c6a9ec0..ff5d884 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -135,7 +135,7 @@ jobs: - id: publish name: "🚀 Publish" - run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.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 }} From 47f5b0b8910882931c708b0095b553928a69fcc9 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:01:16 +0200 Subject: [PATCH 13/24] Fixes --- .github/workflows/gradle.publish.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index ff5d884..b5fb5ea 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -143,15 +143,15 @@ jobs: # CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} crowdinKey: ${{ secrets.CROWDIN_API_KEY }} - - name: "🚀 Create GitHub release" - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - 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' }} +# - name: "🚀 Create GitHub release" +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# 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: needs: [ "compute-version", "notify-build-start", "gradle" ] @@ -164,7 +164,7 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} status: ${{ needs.gradle.result }} - version: "${{ needs.generate-release-information.outputs.full_version }}" + version: "${{ needs.compute-version.outputs.full_version }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: neoforged/action-github-status@v1 From accc1799fdb6935c9de80cf306dbb278cf8b161a Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:04:42 +0200 Subject: [PATCH 14/24] Disable discord temporarily --- .github/workflows/gradle.publish.yaml | 92 +++++++++++++-------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index b5fb5ea..b74897f 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -25,8 +25,8 @@ on: type: number default: 100 secrets: - DISCORD_WEBHOOK: - required: true +# DISCORD_WEBHOOK: +# required: true MAVEN_USER: required: true MAVEN_PASSWORD: @@ -68,28 +68,28 @@ jobs: with: suffix: ${{ needs.generate-release-information.outputs.release_version_suffix }} - notify-build-start: - needs: [ "compute-version" ] - name: "🔴 Build notifications (start)" - runs-on: ubuntu-latest - steps: - - uses: neoforged/action-webhooks@v1 - name: "🔴 Send Discord start notification" - with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK }} - status: 'started' - version: "${{ needs.compute-version.outputs.full_version }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: neoforged/action-github-status@v1 - name: "🚧 Set pending status" - with: - authToken: ${{secrets.GITHUB_TOKEN}} - context: 'Publishing' - state: 'pending' - description: ${{ needs.compute-version.outputs.release_text }} - target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} +# notify-build-start: +# needs: [ "compute-version" ] +# name: "🔴 Build notifications (start)" +# runs-on: ubuntu-latest +# steps: +# - uses: neoforged/action-webhooks@v1 +# name: "🔴 Send Discord start notification" +# with: +# webhook_url: ${{ secrets.DISCORD_WEBHOOK }} +# status: 'started' +# version: "${{ needs.compute-version.outputs.full_version }}" +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# - uses: neoforged/action-github-status@v1 +# name: "🚧 Set pending status" +# with: +# authToken: ${{secrets.GITHUB_TOKEN}} +# context: 'Publishing' +# state: 'pending' +# description: ${{ needs.compute-version.outputs.release_text }} +# target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} gradle: needs: [ "compute-version" ] @@ -153,25 +153,25 @@ jobs: # body_path: changelog.md # prerelease: ${{ inputs.curse_release_type != 'release' }} - notify-build-end: - needs: [ "compute-version", "notify-build-start", "gradle" ] - name: "🔴 Build notifications (end)" - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - uses: neoforged/action-webhooks@v1 - name: "🔴 Send Discord end notification" - with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK }} - status: ${{ needs.gradle.result }} - version: "${{ needs.compute-version.outputs.full_version }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: neoforged/action-github-status@v1 - name: "🚧 Set build status" - with: - authToken: ${{ secrets.GITHUB_TOKEN }} - context: 'Publishing' - state: ${{ needs.gradle.result }} - description: ${{ needs.compute-version.outputs.release_text }} - target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} +# notify-build-end: +# needs: [ "compute-version", "notify-build-start", "gradle" ] +# name: "🔴 Build notifications (end)" +# if: ${{ always() }} +# runs-on: ubuntu-latest +# steps: +# - uses: neoforged/action-webhooks@v1 +# name: "🔴 Send Discord end notification" +# with: +# webhook_url: ${{ secrets.DISCORD_WEBHOOK }} +# status: ${{ needs.gradle.result }} +# version: "${{ needs.compute-version.outputs.full_version }}" +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - uses: neoforged/action-github-status@v1 +# name: "🚧 Set build status" +# with: +# authToken: ${{ secrets.GITHUB_TOKEN }} +# context: 'Publishing' +# state: ${{ needs.gradle.result }} +# description: ${{ needs.compute-version.outputs.release_text }} +# target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} From 04a5257e240994b9f1fd7bc63705e86eb6358426 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:06:49 +0200 Subject: [PATCH 15/24] Remove all vars --- .github/workflows/gradle.publish.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index b74897f..e70448a 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -27,14 +27,14 @@ on: secrets: # DISCORD_WEBHOOK: # required: true - MAVEN_USER: - required: true - MAVEN_PASSWORD: - required: true - CURSE_API_KEY: - required: true - CROWDIN_API_KEY: - required: true +# MAVEN_USER: +# required: true +# MAVEN_PASSWORD: +# required: true +# CURSE_API_KEY: +# required: true +# CROWDIN_API_KEY: +# required: true GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption required: true @@ -136,12 +136,12 @@ jobs: - id: publish name: "🚀 Publish" 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 }} +# env: +# LDTTeamJfrogUsername: ${{ secrets.MAVEN_USER }} +# LDTTeamJfrogPassword: ${{ secrets.MAVEN_PASSWORD }} # CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} # CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} - crowdinKey: ${{ secrets.CROWDIN_API_KEY }} +# crowdinKey: ${{ secrets.CROWDIN_API_KEY }} # - name: "🚀 Create GitHub release" # uses: actions/create-release@v1 From 056f37eabe84712eda13f0b62a59a68e31d2d957 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:07:26 +0200 Subject: [PATCH 16/24] Encryption key not required --- .github/workflows/gradle.publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index e70448a..f6d6e23 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -37,7 +37,7 @@ on: # required: true GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption - required: true + required: false permissions: contents: write From 2ef986b7eed110e31fc7df57172afeca26d3571e Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:09:36 +0200 Subject: [PATCH 17/24] Quote arguments --- .github/workflows/gradle.publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index f6d6e23..74dd7d0 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -120,7 +120,7 @@ jobs: run: | git config --global user.name "GitHub Actions" git config --global user.email "maintainer+github@ldtteam.com" - git tag -a ${{ needs.compute-version.outputs.tag_version }} -m ${{ needs.compute-version.outputs.release_text }} + git tag -a "${{ needs.compute-version.outputs.tag_version }}" -m "${{ needs.compute-version.outputs.release_text }}" - id: generateReleaseChangelog name: "📝 Generate release changelog" From 70064e6b8b78f97cfcc29838fa29ef5eef4dfd85 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:24:29 +0200 Subject: [PATCH 18/24] Output the changelog --- .github/workflows/gradle.publish.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 74dd7d0..b43e9c7 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -133,6 +133,9 @@ jobs: excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} maxIssues: ${{ inputs.changelog_max_issues }} + - id: printChangelog + run: cat changelog.md + - id: publish name: "🚀 Publish" run: ./gradlew --build-cache ${{ inputs.gradle_tasks }} -PmodVersion=${{ needs.compute-version.outputs.mod_version }} -PmodVersionSuffix=${{ needs.compute-version.outputs.suffix }} From f7054f6fa2ce7c4e0265edffdd8df355e660f2b9 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 19:36:09 +0200 Subject: [PATCH 19/24] Fix output misdefined --- .github/workflows/gradle.version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.version.yaml b/.github/workflows/gradle.version.yaml index ae60c65..e4dd783 100644 --- a/.github/workflows/gradle.version.yaml +++ b/.github/workflows/gradle.version.yaml @@ -12,7 +12,7 @@ on: value: ${{ jobs.compute-version.outputs.minecraft_version }} mod_version: description: "The mod version" - value: ${{ jobs.compute-version.outputs.version }} + value: ${{ jobs.compute-version.outputs.mod_version }} suffix: description: "The input suffix" value: ${{ inputs.suffix }} From 76b3c98aa5a05308b531b8d56db0244d98442873 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 20:17:26 +0200 Subject: [PATCH 20/24] Re-enable all steps --- .github/workflows/gradle.publish.yaml | 143 +++++++++++++------------- 1 file changed, 70 insertions(+), 73 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index b43e9c7..0407c92 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -25,19 +25,19 @@ on: type: number default: 100 secrets: -# DISCORD_WEBHOOK: -# required: true -# MAVEN_USER: -# required: true -# MAVEN_PASSWORD: -# required: true -# CURSE_API_KEY: -# required: true -# CROWDIN_API_KEY: -# required: true + DISCORD_WEBHOOK: + required: true + MAVEN_USER: + required: true + MAVEN_PASSWORD: + required: true + CURSE_API_KEY: + required: true + CROWDIN_API_KEY: + required: true GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption - required: false + required: true permissions: contents: write @@ -68,28 +68,28 @@ jobs: with: suffix: ${{ needs.generate-release-information.outputs.release_version_suffix }} -# notify-build-start: -# needs: [ "compute-version" ] -# name: "🔴 Build notifications (start)" -# runs-on: ubuntu-latest -# steps: -# - uses: neoforged/action-webhooks@v1 -# name: "🔴 Send Discord start notification" -# with: -# webhook_url: ${{ secrets.DISCORD_WEBHOOK }} -# status: 'started' -# version: "${{ needs.compute-version.outputs.full_version }}" -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# -# - uses: neoforged/action-github-status@v1 -# name: "🚧 Set pending status" -# with: -# authToken: ${{secrets.GITHUB_TOKEN}} -# context: 'Publishing' -# state: 'pending' -# description: ${{ needs.compute-version.outputs.release_text }} -# target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + notify-build-start: + needs: [ "compute-version" ] + name: "🔴 Build notifications (start)" + runs-on: ubuntu-latest + steps: + - uses: neoforged/action-webhooks@v1 + name: "🔴 Send Discord start notification" + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + status: 'started' + version: "${{ needs.compute-version.outputs.full_version }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: neoforged/action-github-status@v1 + name: "🚧 Set pending status" + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'Publishing' + state: 'pending' + description: ${{ needs.compute-version.outputs.release_text }} + target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} gradle: needs: [ "compute-version" ] @@ -133,48 +133,45 @@ jobs: excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} maxIssues: ${{ inputs.changelog_max_issues }} - - id: printChangelog - run: cat changelog.md - - id: publish name: "🚀 Publish" 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 }} -# CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} -# CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} -# crowdinKey: ${{ secrets.CROWDIN_API_KEY }} + env: + LDTTeamJfrogUsername: ${{ secrets.MAVEN_USER }} + LDTTeamJfrogPassword: ${{ secrets.MAVEN_PASSWORD }} + CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} + CURSE_RELEASE_TYPE: ${{ inputs.curse_release_type }} + crowdinKey: ${{ secrets.CROWDIN_API_KEY }} -# - name: "🚀 Create GitHub release" -# uses: actions/create-release@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# 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' }} + - name: "🚀 Create GitHub release" + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + 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: -# needs: [ "compute-version", "notify-build-start", "gradle" ] -# name: "🔴 Build notifications (end)" -# if: ${{ always() }} -# runs-on: ubuntu-latest -# steps: -# - uses: neoforged/action-webhooks@v1 -# name: "🔴 Send Discord end notification" -# with: -# webhook_url: ${{ secrets.DISCORD_WEBHOOK }} -# status: ${{ needs.gradle.result }} -# version: "${{ needs.compute-version.outputs.full_version }}" -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# - uses: neoforged/action-github-status@v1 -# name: "🚧 Set build status" -# with: -# authToken: ${{ secrets.GITHUB_TOKEN }} -# context: 'Publishing' -# state: ${{ needs.gradle.result }} -# description: ${{ needs.compute-version.outputs.release_text }} -# target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + notify-build-end: + needs: [ "compute-version", "notify-build-start", "gradle" ] + name: "🔴 Build notifications (end)" + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - uses: neoforged/action-webhooks@v1 + name: "🔴 Send Discord end notification" + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ needs.gradle.result }} + version: "${{ needs.compute-version.outputs.full_version }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: neoforged/action-github-status@v1 + name: "🚧 Set build status" + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + context: 'Publishing' + state: ${{ needs.gradle.result }} + description: ${{ needs.compute-version.outputs.release_text }} + target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} From 6c745fe98570f06d29b8091b43df776e49ae85d8 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 21:26:17 +0200 Subject: [PATCH 21/24] Add github token --- .github/workflows/gradle.publish.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 0407c92..a18ef22 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -38,6 +38,8 @@ on: GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption required: true + GITHUB_TOKEN: + required: true permissions: contents: write From 539bf7a57b4e9143536a887e35e681b31a9e0e81 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 21:27:47 +0200 Subject: [PATCH 22/24] Rename --- .github/workflows/gradle.publish.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index a18ef22..1f55688 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -38,7 +38,7 @@ on: GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption required: true - GITHUB_TOKEN: + GH_TOKEN: required: true permissions: @@ -82,12 +82,12 @@ jobs: status: 'started' version: "${{ needs.compute-version.outputs.full_version }}" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - uses: neoforged/action-github-status@v1 name: "🚧 Set pending status" with: - authToken: ${{secrets.GITHUB_TOKEN}} + authToken: ${{ secrets.GH_TOKEN }} context: 'Publishing' state: 'pending' description: ${{ needs.compute-version.outputs.release_text }} @@ -129,7 +129,7 @@ jobs: uses: heinrichreimer/action-github-changelog-generator@v2.4 with: output: changelog.md - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_TOKEN }} stripGeneratorNotice: "true" onlyLastTag: true excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} @@ -148,7 +148,7 @@ jobs: - name: "🚀 Create GitHub release" uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: tag_name: ${{ needs.compute-version.outputs.tag_version }} release_name: ${{ needs.compute-version.outputs.release_text }} @@ -168,11 +168,11 @@ jobs: status: ${{ needs.gradle.result }} version: "${{ needs.compute-version.outputs.full_version }}" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - uses: neoforged/action-github-status@v1 name: "🚧 Set build status" with: - authToken: ${{ secrets.GITHUB_TOKEN }} + authToken: ${{ secrets.GH_TOKEN }} context: 'Publishing' state: ${{ needs.gradle.result }} description: ${{ needs.compute-version.outputs.release_text }} From c054df38de500b1c8eab22edfc99ce3d047dc042 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 21:29:54 +0200 Subject: [PATCH 23/24] Undo --- .github/workflows/gradle.publish.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 1f55688..0407c92 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -38,8 +38,6 @@ on: GRADLE_ENCRYPTION_KEY: description: The AES key to enable Gradle cache encryption required: true - GH_TOKEN: - required: true permissions: contents: write @@ -82,12 +80,12 @@ jobs: status: 'started' version: "${{ needs.compute-version.outputs.full_version }}" env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: neoforged/action-github-status@v1 name: "🚧 Set pending status" with: - authToken: ${{ secrets.GH_TOKEN }} + authToken: ${{secrets.GITHUB_TOKEN}} context: 'Publishing' state: 'pending' description: ${{ needs.compute-version.outputs.release_text }} @@ -129,7 +127,7 @@ jobs: uses: heinrichreimer/action-github-changelog-generator@v2.4 with: output: changelog.md - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} stripGeneratorNotice: "true" onlyLastTag: true excludeTagsRegex: ${{ needs.compute-version.outputs.tag_regex }} @@ -148,7 +146,7 @@ jobs: - name: "🚀 Create GitHub release" uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ needs.compute-version.outputs.tag_version }} release_name: ${{ needs.compute-version.outputs.release_text }} @@ -168,11 +166,11 @@ jobs: status: ${{ needs.gradle.result }} version: "${{ needs.compute-version.outputs.full_version }}" env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: neoforged/action-github-status@v1 name: "🚧 Set build status" with: - authToken: ${{ secrets.GH_TOKEN }} + authToken: ${{ secrets.GITHUB_TOKEN }} context: 'Publishing' state: ${{ needs.gradle.result }} description: ${{ needs.compute-version.outputs.release_text }} From 5277129115b7963bdac3c053357a34f3a4200a23 Mon Sep 17 00:00:00 2001 From: Thom van den Akker Date: Wed, 28 Aug 2024 21:55:39 +0200 Subject: [PATCH 24/24] Add due tag --- .github/workflows/gradle.publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.publish.yaml b/.github/workflows/gradle.publish.yaml index 0407c92..e843b9a 100644 --- a/.github/workflows/gradle.publish.yaml +++ b/.github/workflows/gradle.publish.yaml @@ -130,6 +130,7 @@ jobs: 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 }}