Skip to content

Commit

Permalink
Merge pull request #6 from Fauli1221/main
Browse files Browse the repository at this point in the history
chore: update effectively everything
  • Loading branch information
Sollace authored May 9, 2024
2 parents fee7a56 + 641eb9d commit 010b430
Show file tree
Hide file tree
Showing 129 changed files with 1,252 additions and 770 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
21 changes: 4 additions & 17 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,32 @@ runs:

steps:

# --- Checkout the repo
- name: Check Out Git Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: 'main'

- name: Install nix
uses: cachix/install-nix-action@v22

# --- Install Packwiz
- name: Install packwiz
uses: supplypike/setup-bin@v3
with:
uri: "https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip"
name: "packwiz"
version: "linux"


# --- Build Modrinth Pack If Wanted
- name: Build Modrinth Modpack
if: inputs.build-modrinth == 'true'
run: |
packwiz modrinth export
nix develop --command packwiz modrinth export
echo "::notice ::⚙ Modpack ${{ inputs.modpack }} has been exported as .mrpack"
shell: bash
working-directory: ${{ inputs.modpack }}


# --- Build Curseforge Pack If Wanted
- name: Build CurseForge Modpack
if: inputs.build-curse == 'true'
run: |
packwiz curseforge export
nix develop --command packwiz curseforge export
echo "::notice ::⚙ Modpack ${{ inputs.modpack }} has been exported as .zip"
shell: bash
working-directory: ${{ inputs.modpack }}


# --- Upload the pack/s to releases

- name: Upload Modrinth Modpack to GitHub Releases
if: inputs.build-modrinth == 'true'
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/bump-pack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@ runs:

steps:

# --- Checkout with the named branch
- name: Check Out Git Repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}


# --- Use sed to set the version
- name: Set the Version
run: sed -i 's/version = "[^"]*"/version = "${{ inputs.release-tag }}"/' ${{ inputs.modpack }}/${{ inputs.pack-file }}
shell: bash


# --- Push the version
- name: Push The Updated Version
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/parse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ runs:

steps:

# --- Checkout repo
- name: Check Out Git Repository
uses: actions/checkout@v3


# --- Parse the pack.toml
# I am bored so sorry that I don't explain this, you should probably read the code?
- name: Parse the pack.toml
id: parse
run: |
Expand Down
26 changes: 9 additions & 17 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ inputs:
description: "Should the Modpack Be Uploaded to CurseForge"
required: true

MODRINTH_KEY:
MODRINTH_TOKEN:
required: false
description: "Token used to uploading modpack to Modrinth"
MODRINTH_ID:
required: false
description: "ID used to uploading modpack to Modrinth"
CURSEFORGE_KEY:
CURSEFORGE_TOKEN:
required: false
description: "Token used to uploading modpack to Curseforge"
CURSEFORGE_ID:
Expand All @@ -33,19 +33,17 @@ inputs:
default: .

release-tag:
description: "Tag for the description"
description: "Tag for the release"
required: true


runs:
using: "composite"
steps:

# --- Checkout the repo
- name: Check Out Git Repository
uses: actions/checkout@v3

# --- Download the pack files
- name: Download the pack files
uses: robinraju/[email protected]
id: download-files
Expand All @@ -55,8 +53,6 @@ runs:
tarBall: false
zipBall: false


# --- Get latest release description
- name: Get latest release description
uses: cardinalby/git-get-release-action@v1
id: latest-release
Expand All @@ -65,8 +61,6 @@ runs:
with:
tag: ${{ inputs.release-tag }}


# --- Set publish version-type
- name: Set publish version-type
id: release-type
run: |
Expand All @@ -80,13 +74,11 @@ runs:
shell: bash


# --- Pipe latest release description to file
- name: Pipe latest release description to file
run: echo "${{ steps.latest-release.outputs.body }}" > CHANGELOG.release.md
shell: bash


# --- Print status
- name: Print status
run: |
echo "::notice ::⚙ Assets from latest release ${{ steps.latest-release.outputs.tag_name }} downloaded successfully!"
Expand All @@ -97,15 +89,15 @@ runs:
- name: Publish to Modrinth
id: modrinth
if: inputs.upload-modrinth == 'true'
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: ${{ inputs.MODRINTH_ID }}
modrinth-token: ${{ inputs.MODRINTH_KEY }}
modrinth-token: ${{ inputs.MODRINTH_TOKEN }}
loaders: ${{ env.loader }}
game-versions: ${{ env.game-version }}
changelog-file: CHANGELOG.release.*
files: "*.mrpack"
version: ${{ steps.tag.outputs.tag }}
version: ${{ inputs.release-tag }}
version-type: ${{ steps.release-type.outputs.release-type }}

- name: Print Modrinth upload status
Expand All @@ -117,15 +109,15 @@ runs:
- name: Publish to CurseForge
id: curseforge
if: inputs.upload-curse == 'true'
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
curseforge-id: ${{ inputs.CURSEFORGE_ID }}
curseforge-token: ${{ inputs.CURSEFORGE_KEY }}
curseforge-token: ${{ inputs.CURSEFORGE_TOKEN }}
loaders: ${{ env.loader }}
game-versions: ${{ env.game-version }}
changelog-file: CHANGELOG.release.*
files: "*.zip"
version: ${{ steps.tag.outputs.tag }}
version: ${{ inputs.release-tag }}
version-type: ${{ steps.release-type.outputs.release-type }}

- name: Print Curseforge upload status
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,15 @@ jobs:
contents: write

steps:
# --- Checkout the repo
- name: Check Out Git Repository
uses: actions/checkout@v4

# --- Get current branch
- name: Get current branch
id: branch
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

# --- Set the new version
# TODO: Change to an pr
- name: Set the New Version
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_options: '--allow-empty'
skip_dirty_check: true
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ jobs:

steps:

# -- Checkout repo
- name: Check Out Git Repository
uses: actions/checkout@v4


# --- Parse the modpacks to and list
# This just parses the folders that have pack.toml
- name: List Modpacks
id: list-modpacks
run: |
Expand All @@ -49,7 +45,6 @@ jobs:
echo "modpack-folders=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${modpackFolders[@]}")" >> "$GITHUB_OUTPUT"
# --- Print an nice msg about parsing
- name: Current detected modpacks
run: |
echo "::notice ::⚙ Current detected modpacks: ${{ steps.list-modpacks.outputs.modpack-folders }}"
Expand Down Expand Up @@ -81,8 +76,6 @@ jobs:

steps:

# --- Release please
# Creates and manages the prs and releases
- name: Perform Release with Release Please
id: release-please
uses: google-github-actions/release-please-action@v3
Expand All @@ -100,9 +93,6 @@ jobs:
{"type":"chore","section":"⛭ Miscellaneous","hidden":true}]
# --- Parse version from PR Title when creating PR's
# Had to do this cause like to bump on the release pleae branch
# The tests for the shitty Regex can be found here: https://regexr.com/7lb8e
- name: Parse tag from PR title
uses: actions-ecosystem/action-regex-match@v2
id: version
Expand All @@ -112,16 +102,12 @@ jobs:
if: ${{ steps.release-please.outputs.pr != '' }}


# --- Checkout the git repo
# Remembed to do this AFTER release please
- name: Check Out Git Repository
uses: actions/checkout@v4
with:
fetch-depth: 0


# --- Bump version
# Now we should use the parsed release to bump the version on the files on the release please branch
- name: Bump Version
uses: ./.github/actions/bump-pack
with:
Expand All @@ -131,14 +117,11 @@ jobs:
if: ${{ steps.release-please.outputs.pr != '' }}


# --- Get latest tag
# Should probably be switched to use the release please tag but whatever
- name: Get Latest tag
id: tag
uses: WyriHaximus/github-action-get-previous-tag@v1
if: ${{ steps.release-please.outputs.releases_created }}

# --- Handle the configs
- name: Parse Pack File
id: parse
uses: ./.github/actions/parse
Expand All @@ -149,13 +132,12 @@ jobs:
- name: Set Mod Vendors
id: set-mod-vendors
run: |
[[ ! -z "${{ secrets.CURSEFORGE_KEY }}" && ! -z "${{ secrets.CURSEFORGE_ID }}" ]] && echo "curseforge=true" >> $GITHUB_OUTPUT || echo "curseforge=false" >> $GITHUB_OUTPUT
[[ ! -z "${{ secrets.MODRINTH_KEY }}" && ! -z "${{ secrets.MODRINTH_ID }}" ]] && echo "modrinth=true" >> $GITHUB_OUTPUT || echo "modrinth=false" >> $GITHUB_OUTPUT
[[ ! -z "${{ secrets.CURSEFORGE_TOKEN }}" && ! -z "${{ secrets.CURSEFORGE_ID }}" ]] && echo "curseforge=true" >> $GITHUB_OUTPUT || echo "curseforge=false" >> $GITHUB_OUTPUT
[[ ! -z "${{ secrets.MODRINTH_TOKEN }}" && ! -z "${{ secrets.MODRINTH_ID }}" ]] && echo "modrinth=true" >> $GITHUB_OUTPUT || echo "modrinth=false" >> $GITHUB_OUTPUT
shell: bash
if: ${{ steps.release-please.outputs.releases_created }}


# --- Build an release
- name: Build Modpack
uses: ./.github/actions/build
with:
Expand All @@ -177,9 +159,9 @@ jobs:
upload-modrinth: ${{ steps.set-mod-vendors.outputs.modrinth }}
upload-curse: ${{ steps.set-mod-vendors.outputs.curseforge }}
MODRINTH_ID: ${{ secrets.MODRINTH_ID }}
MODRINTH_KEY: ${{ secrets.MODRINTH_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_ID: ${{ secrets.CURSEFORGE_ID }}
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
if: |
steps.release-please.outputs.releases_created &&
(steps.set-mod-vendors.outputs.modrinth || steps.set-mod-vendors.outputs.curseforge)
12 changes: 4 additions & 8 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,14 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Packwiz
uses: supplypike/setup-bin@v3
with:
uri: 'https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip'
name: 'packwiz'
version: 'linux'
- name: Install nix
uses: cachix/install-nix-action@v26

- name: Update Mods with Packwiz
run: packwiz update -a -y
run: nix develop --command packwiz update -a -y

- name: Push the updated mod list via a Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
commit-message: "update(${{ matrix.modpack }}): updated mods"
title: 'update(${{ matrix.modpack }}): updated mods'
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
*.zip

# Exclude exported Modrinth modpacks
*.mrpack
*.mrpack

# Exclude .direnv
.direnv

# Eclude precommit hooks config
.pre-commit-config.yaml
Loading

0 comments on commit 010b430

Please sign in to comment.