Skip to content
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

Cannot figure out semver in Github Action for some reason. #12

Open
viciscat opened this issue Jan 15, 2025 · 2 comments
Open

Cannot figure out semver in Github Action for some reason. #12

viciscat opened this issue Jan 15, 2025 · 2 comments

Comments

@viciscat
Copy link

Run ./gradlew run --args="--min-version=1.20.4 --override-repo-target=./mc --no-assets --no-datagen-report --no-datagen-snbt --no-datapack --skip-nonlinear"
Downloading https://services.gradle.org/distributions/gradle-8.7-bin.zip
............10%.............20%.............30%.............40%............50%.............60%.............70%.............80%.............90%............100%

Welcome to Gradle 8.7!

Here are the highlights of this release:
 - Compiling and testing with Java 22
 - Cacheable Groovy script compilation
 - New methods in lazy collection properties

For more details see https://docs.gradle.org/8.7/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava NO-SOURCE
> Task :compileGroovy
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :processResources NO-SOURCE
> Task :classes

> Task :run
Integrated datapack versioning is disabled
Asset versioning is disabled
External asset versioning is implicitely disabled
Checksum verification is enabled
Non-Linear version are skipped
Repository creation and versioning is enabled
Versions to decompile: Starting with 1.20.4
Mappings used: mojmap
Repository path is overridden. This may lead to various errors (see help). Proceed with caution. Target: /home/runner/work/GitCraft/GitCraft/./mc
If generated semver is incorrect, it will break the order of the generated repo.
Consider updating Fabric Loader. (run ./gradlew run --refresh-dependencies)
Loading available versions from 'Mojang Minecraft Launcher Main Meta'...
Reading Launcher Meta from https://piston-meta.mojang.com/mc/game/version_manifest_v2.json...
Fetching version meta 25w03a from: https://piston-meta.mojang.com/v1/packages/355a00a8bd037d18e80110a4536d0e8b0ea73270/25w03a.json
Downloaded version meta 25w03a is valid (checksums match)
Fetching client jar client.jar from: https://piston-data.mojang.com/v1/objects/9acca901e3564a91250b941cd2c55a55d0b71bca/client.jar
Error: Exception in thread "main" java.lang.RuntimeException: Exhausted every option of getting a semantic version from 25w03a. It seems like this version needs a manual override. Please report if this issue occurrs.
	at com.github.winplay02.gitcraft.util.MiscHelper.panicBecause(MiscHelper.java:39)
	at com.github.winplay02.gitcraft.manifest.MinecraftLauncherManifest.lookupSemanticVersion(MinecraftLauncherManifest.java:118)
	at com.github.winplay02.gitcraft.manifest.ManifestProvider.loadVersionData(ManifestProvider.java:178)
	at com.github.winplay02.gitcraft.manifest.ManifestProvider.unpackLauncherMeta(ManifestProvider.java:164)
	at com.github.winplay02.gitcraft.manifest.ManifestProvider.getVersionMeta(ManifestProvider.java:118)
	at com.github.winplay02.gitcraft.MinecraftVersionGraph.createFromMetadata(MinecraftVersionGraph.java:[13](https://github.com/SkyblockerMod/GitCraft/actions/runs/12793479018/job/35666414020#step:6:14)5)
	at com.github.winplay02.gitcraft.GitCraft.main(GitCraft.java:70)
Caused by: net.fabricmc.loader.api.VersionParsingException: Could not parse version number component 'w'!
	at net.fabricmc.loader.impl.util.version.SemanticVersionImpl.<init>(SemanticVersionImpl.java:113)
	at net.fabricmc.loader.impl.util.version.VersionParser.parseSemantic(VersionParser.java:45)
	at net.fabricmc.loader.api.SemanticVersion.parse(SemanticVersion.java:105)
	at com.github.winplay02.gitcraft.manifest.MinecraftLauncherManifest.lookupSemanticVersion(MinecraftLauncherManifest.java:1[16](https://github.com/SkyblockerMod/GitCraft/actions/runs/12793479018/job/35666414020#step:6:17))
	... 5 more
Caused by: java.lang.NumberFormatException: For input string: "w"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:662)
	at java.base/java.lang.Integer.parseInt(Integer.java:778)
	at net.fabricmc.loader.impl.util.version.SemanticVersionImpl.<init>(SemanticVersionImpl.java:107)
	... 8 more
Downloaded client jar client.jar is valid (checksums match)

> Task :run FAILED

2 actionable tasks: 2 executed
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/lib/jvm/temurin-[21](https://github.com/SkyblockerMod/GitCraft/actions/runs/12793479018/job/35666414020#step:6:22)-jdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1m 49s

I have been updating the cache manually for a while to get by that issue but i'm tired of that.
I don't think any more info is useful but let me know!

@WinPlay02
Copy link
Owner

I assume it just reuses an old fabric-loader version, that somehow doesn't get updated. Maybe it helps, if you add the --refresh-dependencies flag to the action script?

So the command should look somewhat like this: ./gradlew run --refresh-dependencies --args="--min-version=1.20.4 --override-repo-target=./mc --no-assets --no-datagen-report --no-datagen-snbt --no-datapack --skip-nonlinear"

@viciscat
Copy link
Author

viciscat commented Feb 1, 2025

Just tried it and nope, did not fix it sadly.
here's the workflow btw

name: Run git craft

on:
  workflow_dispatch

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the git craft repo
        uses: actions/checkout@v4
      - name: Checkout the generated mc repo
        uses: actions/checkout@v4
        with:
          ref: master
          path: mc
          fetch-depth: 0
      - name: Set up JDK 21
        uses: actions/setup-java@v4
        with:
          java-version: '21'
          distribution: 'temurin'
      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v3
        with:
          validate-wrappers: true

      - name: Run git craft
        run: |
          ./gradlew run --refresh-dependencies --args="--min-version=1.20.4 --override-repo-target=./mc --no-assets --no-datagen-report --no-datagen-snbt --no-datapack --skip-nonlinear"

      - name: Configure Git
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
      - name: Commit and push changes
        run: |
          cd mc
          git push origin master
        env:
          # This token is automatically provided by GitHub Actions
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants