mirror of
https://github.com/Nostalgica-Reverie/Content-Monorepo.git
synced 2026-05-09 00:24:15 +00:00
200 lines
6.3 KiB
YAML
200 lines
6.3 KiB
YAML
name: RC Builds
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'versions/vanilla/src/re-console/curseforge/**'
|
|
- 'versions/vanilla/src/re-console/modrinth/**'
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'versions/vanilla/src/re-console/curseforge/**'
|
|
- 'versions/vanilla/src/re-console/modrinth/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# modrinth fabric
|
|
- version: "1.20.1"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.20.4"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.1"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.3"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.4"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.5"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.8"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.10"
|
|
loader: "fabric"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
# modrinth quilt
|
|
- version: "1.20.1"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.20.4"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.1"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.3"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.4"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.5"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.8"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
- version: "1.21.10"
|
|
loader: "quilt"
|
|
platform: "modrinth"
|
|
file_ext: "mrpack"
|
|
# curseforge fabric
|
|
- version: "1.20.1"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.20.4"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.21.1"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.21.3"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.21.4"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.21.5"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
- version: "1.21.8"
|
|
loader: "fabric"
|
|
platform: "curseforge"
|
|
file_ext: "zip"
|
|
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
commit_sha: ${{ steps.vars.outputs.commit_sha }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PACK_NAME: Re-Console
|
|
OUTPUT: artifacts
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
# Cache Packwiz binary to avoid Go setup and compilation
|
|
- name: Cache Packwiz Binary
|
|
uses: actions/cache@v4
|
|
id: cache-packwiz
|
|
with:
|
|
path: ~/go/bin/packwiz
|
|
key: packwiz-binary-${{ runner.os }}-v1
|
|
restore-keys: |
|
|
packwiz-binary-${{ runner.os }}-
|
|
|
|
# Only set up Go and install Packwiz if not cached
|
|
- name: Set up Go
|
|
if: steps.cache-packwiz.outputs.cache-hit != 'true'
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: false
|
|
|
|
- name: Install Packwiz
|
|
if: steps.cache-packwiz.outputs.cache-hit != 'true'
|
|
run: go install github.com/packwiz/packwiz@latest
|
|
|
|
# Add Packwiz to PATH (whether cached or freshly installed)
|
|
- name: Add Packwiz to PATH
|
|
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
|
|
|
- name: Create short commit SHA
|
|
id: vars
|
|
run: |
|
|
shortSha=$(git rev-parse --short ${{ github.sha }})
|
|
echo "COMMIT_SHORT_SHA=$shortSha" >> $GITHUB_ENV
|
|
echo "commit_sha=$shortSha" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build ${{ matrix.version }}-${{ matrix.loader }}-${{ matrix.platform }}
|
|
run: |
|
|
mkdir RC-${{ matrix.platform }}-${{ matrix.loader }}-${{ matrix.version }}-temp
|
|
cp -r ./versions/vanilla/src/re-console/${{ matrix.platform }}/${{ matrix.loader }}/${{ matrix.version }}/* ./RC-${{ matrix.platform }}-${{ matrix.loader }}-${{ matrix.version }}-temp/
|
|
cp ./LICENSE ./RC-${{ matrix.platform }}-${{ matrix.loader }}-${{ matrix.version }}-temp/
|
|
cp ./README.md ./RC-${{ matrix.platform }}-${{ matrix.loader }}-${{ matrix.version }}-temp/
|
|
cd ./RC-${{ matrix.platform }}-${{ matrix.loader }}-${{ matrix.version }}-temp/
|
|
packwiz refresh
|
|
mkdir -p ../$OUTPUT
|
|
packwiz ${{ matrix.platform }} export --output ../${OUTPUT}/${PACK_NAME}-${{ matrix.version }}-${{ matrix.loader }}-dev-${{ matrix.platform }}-${{ env.COMMIT_SHORT_SHA }}.${{ matrix.file_ext }}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "Re-Console-${{ matrix.version }}-${{ matrix.loader }}-${{ matrix.platform }}-dev-${{ env.COMMIT_SHORT_SHA }}"
|
|
path: artifacts
|
|
|
|
combine:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: downloaded-artifacts
|
|
|
|
- name: Combine artifacts
|
|
run: |
|
|
mkdir combined-artifacts
|
|
find downloaded-artifacts -name "*.mrpack" -exec cp {} combined-artifacts/ \;
|
|
find downloaded-artifacts -name "*.zip" -exec cp {} combined-artifacts/ \;
|
|
|
|
- name: Upload combined artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "Re-Console-dev-${{ needs.build.outputs.commit_sha }}"
|
|
path: combined-artifacts
|