Kir-Antipov / mc-publish

🚀 Your one-stop GitHub Action for seamless Minecraft project publication across various platforms.
MIT License
216 stars 19 forks source link

FileNotFoundError: Could not find file 'CHANGELOG.md'. #99

Closed mineTomek closed 7 months ago

mineTomek commented 7 months ago

The workflow can't find the CHANGELOG.md file even though it's at the project root. The workflow file looks like this:

on:
  push:
    branches:
    - main
  workflow_dispatch:

jobs:
  publish_the_mod:
    name: Publish To Modrinth and GitHub
    runs-on: ubuntu-latest
    steps:
      - uses: Kir-Antipov/mc-publish@v3.3
        with:
          modrinth-id: P9DbqD2L
          modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

          github-tag: mc1.20.2-0.0.1
          github-prerelease: true
          github-token: ${{ secrets._GITHUB_TOKEN }}

          name: Redstonery Mod 0.0.1 for Minecraft 1.20.2
          version: mc1.20.2-0.0.1
          version-type: alpha
          changelog-file: CHANGELOG.md

          loaders: |
            fabric
          game-versions: |
            1.20.2
mineTomek commented 7 months ago

The full repo is here: https://github.com/mineTomek/RedstoneryMod

mineTomek commented 7 months ago

The job that failed is here: https://github.com/mineTomek/RedstoneryMod/actions/runs/6934873433/job/18863873260

Kir-Antipov commented 7 months ago

Yes, CHANGELOG.md is indeed located at your project's root. However, the workflow you've setup is completely empty. When you work with GitHub Actions here are the basic steps you almost always need to take:

1) Checkout - you can think of it as git clone, but with extra steps. This way your project will be actually accessible within the runner. 2) Install the SDK you need to build the project. In your case, it's Java 17. 3) Build the project and/or test it.

After that you are free to perform any other additional actions with the produced artifacts (e.g., pass them to mc-publish, so it can publish them).

Here's a simplistic example of how I usually use my own action:

name: release-artifacts

on:
  release:
    types:
      - published

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up JDK 17
        uses: actions/setup-java@v3
        with:
          distribution: temurin
          java-version: 17

      - name: Make gradlew executable
        run: chmod +x ./gradlew

      - name: Build artifacts
        run: ./gradlew clean build

      - name: Upload assets to GitHub, Modrinth and CurseForge
        uses: Kir-Antipov/mc-publish@v3.3
        with:
          name: ""
          modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
          curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

Hope this helps :)

mineTomek commented 7 months ago

I'm very sorry for making such an error.

Kir-Antipov commented 6 months ago

Don't worry, there's nothing to be sorry about! I'm sure lots of people might feel a bit confused at first by the way GitHub Actions work, especially when they rush into setting them up without reading the docs first ;)