Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace authored Nov 27, 2023
0 parents commit 971a5d1
Show file tree
Hide file tree
Showing 19 changed files with 996 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Disable Git line ending conversion, to prevent packwiz index hashes changing when committing from Windows
* -text
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-for-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request for CI
about: Suggest an idea for this project to use in the CI actions
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-for-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request for docs
about: Suggest an idea for this project to use in it's README
title: ''
labels: documentation
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-for-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-for-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Question
about: Ask a question about this project
title: ''
labels: question
assignees: ''

---

**Describe the question**
A clear and concise description of the question.

**Is your question related to a problem? Please describe.**
A clear and concise description of what the problem is. E.g., I'm always frustrated when [...]

**Additional context**
Add any other context or screenshots about the feature request here.

- [ ] Clarification needed
- [ ] Technical issue
- [ ] Conventional commits
- [ ] Problems with GitHub Actions
- [ ] Versioning
84 changes: 84 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Build Modpack Action | Action'
description: 'Uses packwiz to build the modpack!'
inputs:
release-tag:
description: "The release tag for the modpack upload"
required: true
build-modrinth:
description: "Set to 'true' to build the Modrinth .mrpack file"
required: true
build-curse:
description: "Set to 'true' to build the CurseForge .zip file"
required: true
modpack:
description: "Path to the modpack directory"
required: false
default: '.'

runs:
using: "composite"

steps:

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


# --- 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
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
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: |
gh release upload ${{ inputs.release-tag }} *.mrpack \
--repo ${{ github.repository_owner }}/${{ github.event.repository.name }} \
--clobber
echo "::notice ::☀ Modpack ${{ inputs.modpack }} has been uploaded to GitHub Releases as a .mrpack"
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
working-directory: ${{ inputs.modpack }}

- name: Upload CurseForge Modpack to GitHub Releases
if: inputs.build-curse == 'true'
run: |
gh release upload ${{ inputs.release-tag }} *.zip \
--repo ${{ github.repository_owner }}/${{ github.event.repository.name }} \
--clobber
echo "::notice ::☀ Modpack ${{ inputs.modpack }} has been uploaded to GitHub Releases as a .zip"
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
working-directory: ${{ inputs.modpack }}
43 changes: 43 additions & 0 deletions .github/actions/bump-pack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Bump Modpack Action | Action'
description: 'Bump a modpacks version'

inputs:
release-tag:
description: 'The release tag to bump the modpack to'
required: true
modpack:
description: 'Path to the modpack directory'
required: false
default: '.'
pack-file:
description: 'Path to the pack config file'
required: false
default: 'pack.toml'
branch:
description: "Branch, where to do the bump"
required: false
default: 'main'

runs:
using: 'composite'

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:
commit_message: "chore(${{ inputs.modpack }}): bump version to ${{ inputs.release-tag }}"
53 changes: 53 additions & 0 deletions .github/actions/parse/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Parse Modpack | Action'
description: 'Parses a modpacks pack file'

inputs:
modpack:
description: 'Path to the modpack directory'
required: false
default: '.'
pack-file:
description: 'Path to the pack config file'
required: false
default: 'pack.toml'

outputs:
loader:
description: 'Detected mod loader'
value: ${{ steps.parse.outputs.loader }}
game-version:
description: 'Detected game version'
value: ${{ steps.parse.outputs.game-version }}

runs:
using: 'composite'

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: |
loaders=("fabric" "forge" "quilt" "neoforge")
for loader in "${loaders[@]}"; do
if [[ $(<"${{ inputs.pack-file }}") == *"$loader ="* ]]; then
LOADER="$loader" && break
fi
done
[[ -z "$LOADER" ]] && { echo "::error file=${{ inputs.pack-file }}::No match found for loaders in ${{ inputs.pack-file }}" && exit 1; }
GAME_VERSION=$(grep -oP 'minecraft = "\K[^"]+' "${{ inputs.pack-file }}")
echo "loader=$LOADER" >> $GITHUB_ENV
echo "game-version=$GAME_VERSION" >> $GITHUB_ENV
echo "::notice ::⚙ The detected loader for ${{ inputs.modpack }} is $LOADER"
echo "::notice ::⚙ The detected game version for ${{ inputs.modpack }} is $GAME_VERSION"
shell: bash
working-directory: ${{ inputs.modpack }}
Loading

0 comments on commit 971a5d1

Please sign in to comment.