diff --git a/.github/actions/build_setup/action.yml b/.github/actions/build_setup/action.yml index e81e445..6509a48 100644 --- a/.github/actions/build_setup/action.yml +++ b/.github/actions/build_setup/action.yml @@ -31,5 +31,5 @@ runs: uses: gradle/actions/setup-gradle@v4 with: cache-write-only: ${{ inputs.update-cache }} - cache-read-only: ${{ github.ref != 'refs/heads/1.21' }} + cache-read-only: ${{ github.ref != 'refs/heads/main' }} add-job-summary: 'on-failure' diff --git a/.github/json/config-latest.json b/.github/json/config-latest.json index 48ba115..0da2893 100644 --- a/.github/json/config-latest.json +++ b/.github/json/config-latest.json @@ -20,10 +20,6 @@ "ignore_labels": ["ignore changelog"], "tag_resolver": { "method": "semver", - "filter": { - "pattern": "^(?!v?[0-9\\.]+(-1\\.21)$).+$", - "flags": "gu" - }, "transformer": { "pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?", "target": "$1" @@ -31,5 +27,5 @@ }, "max_pull_requests": 1000, "max_back_track_time_days": 365, - "base_branches": ["1.21"] -} \ No newline at end of file + "base_branches": ["main"] +} diff --git a/.github/json/config.json b/.github/json/config.json index fce0e05..1a1a547 100644 --- a/.github/json/config.json +++ b/.github/json/config.json @@ -30,10 +30,6 @@ "ignore_labels": ["ignore changelog"], "tag_resolver": { "method": "semver", - "filter": { - "pattern": "^(?!v?[0-9\\.]+(-1\\.21)$).+$", - "flags": "gu" - }, "transformer": { "pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?", "target": "$1" @@ -41,5 +37,5 @@ }, "max_pull_requests": 1000, "max_back_track_time_days": 365, - "base_branches": ["1.21"] -} \ No newline at end of file + "base_branches": ["main"] +} diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 8cfb553..e523784 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -2,7 +2,7 @@ name: Latest Build on: push: - branches: ['1.21'] + branches: ['main'] paths: ['**/src/**', '**/*.gradle', 'gradle.properties', 'gradle/**', 'gradlew*'] concurrency: @@ -61,11 +61,11 @@ jobs: if: ${{ env.PUBLISH == 'true' }} uses: andelf/nightly-release@46e2d5f80828ecc5c2c3c819eb31186a7cf2156c with: - tag_name: latest-${{ github.ref_name }} - name: '${{ github.ref_name }}-${{ steps.ver.outputs.version}} SNAPSHOT ${{ env.VERSION_SUFFIX }}' + tag_name: latest + name: 'MixinSplice ${{ steps.ver.outputs.version }} SNAPSHOT ${{ env.VERSION_SUFFIX }}' prerelease: true body: | - The latest build of MixinSplice for Minecraft ${{ github.ref_name }}. + The latest build of MixinSplice for Fabric, Forge, and NeoForge. Please report any [issues](${{ github.server_url }}/${{ github.repository }}/issues). ${{ steps.changelog.outputs.changelog }} files: build/libs/*.jar diff --git a/.github/workflows/format-java.yml b/.github/workflows/format-java.yml index af40321..e07b1fc 100644 --- a/.github/workflows/format-java.yml +++ b/.github/workflows/format-java.yml @@ -3,7 +3,7 @@ name: Java Formatting on: push: - branches: ['1.21'] + branches: ['main'] paths: - '**/src/*/java/**' - '**/src/*/kotlin/**' diff --git a/.github/workflows/manage-issue-labels.yml b/.github/workflows/manage-issue-labels.yml index 618fde0..424def6 100644 --- a/.github/workflows/manage-issue-labels.yml +++ b/.github/workflows/manage-issue-labels.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: '1.21' + ref: main sparse-checkout: '.github/labeler.yml' - uses: github/issue-labeler@v3.3 with: diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml index 5fe5088..26a73e7 100644 --- a/.github/workflows/publish-on-release.yml +++ b/.github/workflows/publish-on-release.yml @@ -30,15 +30,13 @@ jobs: fetchViaCommits: true failOnError: true - publish-21: - name: 1.21.1 + publish: + name: Publish MixinSplice needs: [ meta ] - if: ${{ contains(github.ref_name, '1.21') }} secrets: inherit uses: ./.github/workflows/publish.yml with: simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'ExtremelyFrozen' }} tag-name: ${{ github.ref_name }} - version: '1.21' release-body: ${{ github.event.release.body }} - changelog-body: ${{ needs.meta.outputs.CHANGELOG }} \ No newline at end of file + changelog-body: ${{ needs.meta.outputs.CHANGELOG }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3ce1baa..8188e8e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,10 +10,6 @@ on: description: 'Tag to build from and upload to' required: true type: string - version: - description: 'Version identifier; 1.21' - required: true - type: string release-body: description: 'Body for published release notes' required: false @@ -80,72 +76,6 @@ jobs: files: ./*.jar fail_on_unmatched_files: true - # publish-modrinth: - # name: Publish to Modrinth - # needs: build - # if: ${{ !inputs.simulate }} - # runs-on: ubuntu-latest - # permissions: - # contents: write - # steps: - # - name: Download artifacts - # uses: actions/download-artifact@v4 - # with: - # name: build-artifacts-${{ inputs.branch }} - # - name: Publish Mod - # env: - # MC_VERSION: ${{ inputs.branch == '1.21' && '1.21.1' || '1.20.1' }} - # LOADER: ${{ inputs.branch == '1.21' && 'neoforge' || 'forge' }} - # JAVA: ${{ inputs.branch == '1.21' && '21' || '17' }} - # VERSION_TYPE: ${{ inputs.branch == '1.21' && 'beta' || 'beta' }} - # uses: Kir-Antipov/mc-publish@v3.3.0 - # with: - # modrinth-id: aADDBrNC - # modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - # files: | - # ./gtmoremachine-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar - # ./!(gtmoremachine-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar) - # name: 'GTMoreMachine ${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}' - # version: 'mc${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}' - # version-type: ${{ env.VERSION_TYPE }} - # changelog: ${{ inputs.release-body }} - # loaders: ${{ env.LOADER }} - # java: ${{ env.JAVA }} - # fail-mode: fail - # - # publish-cf: - # name: Publish to CF - # needs: build - # if: ${{ !inputs.simulate }} - # runs-on: ubuntu-latest - # permissions: - # contents: write - # steps: - # - name: Download artifacts - # uses: actions/download-artifact@v4 - # with: - # name: build-artifacts-${{ inputs.branch }} - # - name: Publish Mod - # env: - # MC_VERSION: ${{ inputs.branch == '1.21' && '1.21.1' || '1.20.1' }} - # LOADER: ${{ inputs.branch == '1.21' && 'neoforge' || 'forge' }} - # JAVA: ${{ inputs.branch == '1.21' && '21' || '17' }} - # VERSION_TYPE: ${{ inputs.branch == '1.21' && 'alpha' || 'beta' }} - # uses: Kir-Antipov/mc-publish@v3.3.0 - # with: - # curseforge-id: 1397216 - # curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - # files: | - # ./gtmoremachine-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar - # ./!(gtmoremachine-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar) - # name: 'GTMoreMachine ${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}' - # version: 'mc${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}' - # version-type: ${{ env.VERSION_TYPE }} - # changelog: ${{ inputs.release-body }} - # loaders: ${{ env.LOADER }} - # java: ${{ env.JAVA }} - # fail-mode: fail - # 发布成功后,通过 PR 更新版本号和变更日志。 bump-version-and-changelog: name: Bump Version and Build Changelog @@ -163,7 +93,7 @@ jobs: run: | git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git switch -C gh/release-${{ inputs.version }} + git switch -C gh/release-${{ inputs.branch }} BUMPED=$(echo ${{ needs.build.outputs.ver }} | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.) sed -i "s/= ${{ needs.build.outputs.ver }}/= ${BUMPED}/" gradle.properties git commit -am "Bump version to ${BUMPED}" @@ -176,5 +106,5 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - git push --force --set-upstream origin gh/release-${{ inputs.version }} - gh pr create -B ${{ inputs.version }} -H gh/release-${{ inputs.version }} --title "RELEASE for ${{ inputs.version }} [no-snapshot]" --body "Created by GH Workflow" --label "ignore changelog" + git push --force --set-upstream origin gh/release-${{ inputs.branch }} + gh pr create -B ${{ inputs.branch }} -H gh/release-${{ inputs.branch }} --title "RELEASE for ${{ inputs.branch }} [no-snapshot]" --body "Created by GH Workflow" --label "ignore changelog" diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index e11c4cf..c2c44b8 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -2,7 +2,7 @@ name: Sync Github Folder on: push: - branches: ['1.21'] + branches: ['main'] paths: ['.github/**'] jobs: @@ -17,7 +17,7 @@ jobs: git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git switch -C gh/workflow-sync git fetch origin - git checkout origin/1.21 -- .github + git checkout origin/main -- .github git add .github git commit --allow-empty -m "Sync Workflows" git push --force --set-upstream origin gh/workflow-sync diff --git a/.github/workflows/update-gradle-cache.yml b/.github/workflows/update-gradle-cache.yml index 4f86135..5b9f22f 100644 --- a/.github/workflows/update-gradle-cache.yml +++ b/.github/workflows/update-gradle-cache.yml @@ -3,7 +3,7 @@ name: Update Gradle Cache on: push: - branches: ['1.21'] + branches: ['main'] paths: ['gradle/**', '**/*.gradle', 'gradle.properties', 'gradlew*'] workflow_dispatch: diff --git a/gradle/scripts/jars.gradle b/gradle/scripts/jars.gradle index 55194dd..a7e5a38 100644 --- a/gradle/scripts/jars.gradle +++ b/gradle/scripts/jars.gradle @@ -80,7 +80,7 @@ def publishedSources = fabric ? tasks.named('remapSourcesJar', Jar) : sourcesArc base { // 平台子项目名同时用作发行文件名中的 Loader 标识。 - archivesName = "${rootProject.name}-${project.name}-${libs.versions.minecraft.get()}" + archivesName = "${rootProject.name}-${project.name}" } [mainArchive, slimArchive, publishedSources].each { archive ->