Kir-Antipov/mc-publish

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

Closed this issue · 5 comments

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

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 :)

I'm very sorry for making such an error.

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 ;)