Skip to content

Release Latest Nightly to CurseForge as Alpha #1

Release Latest Nightly to CurseForge as Alpha

Release Latest Nightly to CurseForge as Alpha #1

name: Release Latest Nightly to CurseForge as Alpha
on:
workflow_dispatch:
jobs:
get-package-info:
name: Get Latest Package Info
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.download-info.outputs.version }}
steps:
- name: Download Package Info
id: download-info
uses: compactmods/[email protected]
env:
GQL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
owner: compactmods
repo: compactmachines
group: dev.compactmods.compactmachines.compactmachines-neoforge
filter: "^compactmachines-neoforge-(?:[\\d\\.]+)-nightly.jar$"
outputFile: compactmachines-nightly.json
- name: Debug output
run: |
echo "Version: ${{ steps.download-info.outputs.version }}"
cat compactmachines-nightly.json
- name: Read info into variable [latest]
id: info
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
- name: Download JAR and prepare artifacts
run: |
mkdir release
curl -L "${{ fromJson(steps.info.outputs.latestJson)[0].url }}" -o "release/${{ fromJson(steps.info.outputs.latestJson)[0].name}}"
mv compactmachines-nightly.json release/compactmachines-nightly.json
- name: Add Artifact
uses: actions/upload-artifact@v4
with:
name: release
path: release
release-cf:
name: Make Curseforge Release
runs-on: ubuntu-20.04
needs: [get-package-info]
steps:
- name: Grab JAR and Info
uses: actions/download-artifact@v4
with:
name: release
path: .
- name: Read info into variable [latest]
id: info
run: echo "latestJson=$(cat compactmachines-nightly.json)" >> $GITHUB_OUTPUT
- name: Create CurseForge Release
uses: itsmeow/curseforge-upload@master
with:
token: ${{ secrets.CURSEFORGE_TOKEN }}
project_id: ${{ secrets.CF_PROJECT }}
game_endpoint: minecraft
file_path: ${{ fromJson(steps.info.outputs.latestJson)[0].name}}
game_versions: java:Java 21,NeoForge
release_type: alpha