update: .github
This commit is contained in:
parent
f1a078e3eb
commit
201255cff4
40 changed files with 7818 additions and 1699 deletions
480
.github/workflows/build.yml
vendored
Normal file
480
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,480 @@
|
|||
name: Project Build
|
||||
run-name: "Project Build #${{ github.run_number }}"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RELEASE_TYPE: "alpha"
|
||||
MINECRAFT_VERSION: "1.20.1"
|
||||
|
||||
jobs:
|
||||
info:
|
||||
name: 🖥️ Project Info
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
project_version: ${{ steps.project_version.outputs.value }}
|
||||
project_name: ${{ steps.project_name.outputs.value }}
|
||||
project_full_name: ${{ steps.project_name.outputs.value }}-${{ steps.project_version.outputs.value }}
|
||||
changelog: ${{ steps.changelog.outputs.description }}
|
||||
diff: ${{ steps.read_diff.outputs.diff }}
|
||||
release_type: ${{ env.RELEASE_TYPE }}
|
||||
minecraft_version: ${{ env.MINECRAFT_VERSION }}
|
||||
exists: ${{ steps.check_tag.outputs.exists }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🔍 Check pakku-lock.json
|
||||
id: check_pakku_lock
|
||||
shell: bash
|
||||
run: |
|
||||
if [ ! -f pakku-lock.json ]; then
|
||||
echo "❌ Could not find pakku-lock.json" && exit 1
|
||||
else
|
||||
echo "✔️ pakku-lock.json"
|
||||
fi
|
||||
|
||||
- name: 🔍 Check pakku.json
|
||||
id: check_pakku
|
||||
shell: bash
|
||||
run: |
|
||||
if [ ! -f pakku.json ]; then
|
||||
echo "❌ Could not find pakku.json" && exit 1
|
||||
else
|
||||
echo "✔️ pakku.json"
|
||||
fi
|
||||
|
||||
- name: 📈 Get latest tag
|
||||
id: latest_tag
|
||||
shell: bash
|
||||
run: |
|
||||
tag=$(git describe --tags --abbrev=0)
|
||||
if [ -z "$tag" ]; then
|
||||
echo "❌ Latest tag not found" && exit 1
|
||||
else
|
||||
echo "✔️ Latest tag found: $tag"
|
||||
echo "tag=$tag" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: 🔍 Check pakku-lock.json in previous tag
|
||||
id: check_pakku_lock_prev
|
||||
shell: bash
|
||||
run: |
|
||||
if ! git ls-tree -r ${{ steps.latest_tag.outputs.tag }} -- ./pakku-lock.json &> /dev/null; then
|
||||
echo "❌ File pakku-lock.json not found in previous tag" && exit 1
|
||||
else
|
||||
echo "✔️ File pakku-lock.json found in previous tag"
|
||||
fi
|
||||
|
||||
- name: 📁 Copy pakku-lock.json from previous tag
|
||||
id: copy_pakku_lock_prev
|
||||
shell: bash
|
||||
run: |
|
||||
git show tags/${{ steps.latest_tag.outputs.tag }}:./pakku-lock.json > ./pakku-lock-prev.json
|
||||
if [ -s ./pakku-lock-prev.json ]; then
|
||||
echo "✔️ File pakku-lock-prev.json created"
|
||||
else
|
||||
echo "❌ Error: File pakku-lock-prev.json is empty or not created" && exit 1
|
||||
fi
|
||||
|
||||
- name: 📦 Download pakku.jar
|
||||
id: download_pakku
|
||||
shell: bash
|
||||
run: |
|
||||
curl https://github.com/juraj-hrivnak/pakku/releases/latest/download/pakku.jar -o pakku.jar -L -J
|
||||
echo "✔️ Downloaded pakku.jar "
|
||||
|
||||
- name: 🔄 Run pakku diff
|
||||
id: pakku_diff
|
||||
shell: bash
|
||||
run: |
|
||||
java -jar pakku.jar diff -v --markdown PROJECTS_DIFF.md ./pakku-lock-prev.json ./pakku-lock.json
|
||||
if [ -f PROJECTS_DIFF.md ]; then
|
||||
echo "✔️ Comparison completed"
|
||||
else
|
||||
echo "❌ Error: File PROJECTS_DIFF.md not created" && exit 1
|
||||
fi
|
||||
|
||||
- name: 📝 Read PROJECTS_DIFF.md to variable
|
||||
id: read_diff
|
||||
shell: bash
|
||||
run: |
|
||||
echo "📝 Reading PROJECTS_DIFF.md to variable..."
|
||||
{
|
||||
echo 'diff<<EOF'
|
||||
cat -v PROJECTS_DIFF.md
|
||||
echo EOF
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
echo "✔️ Diff content read to variable"
|
||||
|
||||
- name: 📊 Get Project Name
|
||||
id: project_name
|
||||
uses: ActionsTools/read-json-action@v1.0.5
|
||||
with:
|
||||
file_path: "pakku.json"
|
||||
prop_path: "name"
|
||||
|
||||
- name: 📊 Get Project Version
|
||||
id: project_version
|
||||
uses: ActionsTools/read-json-action@v1.0.5
|
||||
with:
|
||||
file_path: "pakku.json"
|
||||
prop_path: "version"
|
||||
|
||||
- name: 📊 Get Minecraft Version
|
||||
id: minecraft_version
|
||||
uses: ActionsTools/read-json-action@v1.0.5
|
||||
with:
|
||||
file_path: "pakku-lock.json"
|
||||
prop_path: "mc_versions"
|
||||
|
||||
- name: 📄 Changelog Parser
|
||||
id: changelog
|
||||
uses: coditory/changelog-parser@v1.0.2
|
||||
with:
|
||||
path: CHANGELOG.md
|
||||
|
||||
- name: 📈 Upload Diff
|
||||
id: upload_diff
|
||||
if: ${{ steps.read_diff.outputs.diff != '' }}
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: Mods-diff
|
||||
path: PROJECTS_DIFF.md
|
||||
|
||||
- name: 🔍 Check if tag exists
|
||||
uses: mukunku/tag-exists-action@v1.6.0
|
||||
id: check_tag
|
||||
with:
|
||||
tag: ${{ steps.project_version.outputs.value }}
|
||||
|
||||
- name: 📝 Generate Github Summary
|
||||
run: |
|
||||
echo "📃 **Name**: ${{ steps.project_name.outputs.value }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "📃 **Release**: ${{ steps.project_version.outputs.value }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "📃 **Release Type**: ${{ env.RELEASE_TYPE }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "📃 **Game Version**: ${{ env.MINECRAFT_VERSION }}" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
echo "${{ steps.changelog.outputs.description }}" >> $GITHUB_STEP_SUMMARY
|
||||
if [ -n "${{ steps.read_diff.outputs.diff != '' }}" ]; then
|
||||
echo "${{ steps.read_diff.outputs.diff }}" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
|
||||
build-modpack:
|
||||
name: 📦 Build Modpack
|
||||
needs: [info]
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.info.outputs.exists != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: 🔄 Replace strings
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
|
||||
VERSION=${{ needs.info.outputs.project_version }}
|
||||
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt
|
||||
|
||||
# - name: Cache pakku
|
||||
# uses: actions/cache@v4.1.2
|
||||
# with:
|
||||
# path: build/.cache
|
||||
# key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }}
|
||||
# restore-keys: ${{ runner.OS }}-pakku-cache-
|
||||
|
||||
- name: 📦 Export modpack
|
||||
run: |
|
||||
curl https://github.com/juraj-hrivnak/pakku/releases/latest/download/pakku.jar -o pakku.jar -L -J
|
||||
java -jar pakku.jar export
|
||||
|
||||
- name: 📁 Rename artifact curseforge
|
||||
run: |
|
||||
cd ./build/curseforge/
|
||||
mv *.zip $(basename -s .zip *.zip)-curseforge.zip
|
||||
|
||||
- name: 🚀 Upload artifact CurseForge
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-curseforge
|
||||
path: ./build/curseforge/${{ needs.info.outputs.project_full_name }}-curseforge.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: 📁 Rename artifact modrinth
|
||||
run: |
|
||||
cd ./build/modrinth/
|
||||
mv *.mrpack $(basename -s .mrpack *.mrpack)-modrinth.mrpack
|
||||
|
||||
- name: 🚀 Upload artifact modrinth
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-modrinth
|
||||
path: ./build/modrinth/${{ needs.info.outputs.project_full_name }}-modrinth.mrpack
|
||||
if-no-files-found: warn
|
||||
|
||||
build-server:
|
||||
name: 📦 Build Server
|
||||
needs: [info]
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.info.outputs.exists != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: 🔄 Replace strings
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
|
||||
VERSION=${{ needs.info.outputs.project_version }}
|
||||
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt
|
||||
|
||||
# - name: Cache pakku
|
||||
# uses: actions/cache@v4.1.2
|
||||
# with:
|
||||
# path: build/.cache
|
||||
# key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }}
|
||||
# restore-keys: ${{ runner.OS }}-pakku-cache-
|
||||
|
||||
- name: 📦 Export modpack
|
||||
run: |
|
||||
mv -vf ./.pakku/server-overrides/* ./
|
||||
curl https://github.com/juraj-hrivnak/pakku/releases/latest/download/pakku.jar -o pakku.jar -L -J
|
||||
java -jar pakku.jar export
|
||||
|
||||
- name: 📁 Rename artifact server
|
||||
run: |
|
||||
cd ./build/serverpack/
|
||||
mv *.zip $(basename -s .zip *.zip)-serverpack.zip
|
||||
|
||||
- name: 🚀 Upload artifact server
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-serverpack
|
||||
path: ./build/serverpack/${{ needs.info.outputs.project_full_name }}-serverpack.zip
|
||||
if-no-files-found: error
|
||||
|
||||
build-multimc:
|
||||
name: 📦 Build MultiMC
|
||||
needs: [info]
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.info.outputs.exists != 'true'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: 🔄 Replace strings
|
||||
shell: bash
|
||||
run: |
|
||||
set +e
|
||||
|
||||
VERSION=${{ needs.info.outputs.project_version }}
|
||||
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt
|
||||
sed -i -e "s/DEV/${VERSION}/g" .pakku/multimc-overrides/instance.cfg
|
||||
|
||||
# - name: Cache pakku
|
||||
# uses: actions/cache@v4.1.2
|
||||
# with:
|
||||
# path: build/.cache
|
||||
# key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }}
|
||||
# restore-keys: ${{ runner.OS }}-pakku-cache-
|
||||
|
||||
- name: 📦 Export
|
||||
run: |
|
||||
curl https://github.com/juraj-hrivnak/pakku/releases/latest/download/pakku.jar -o pakku.jar -L -J
|
||||
java -jar pakku.jar --debug fetch
|
||||
java -jar pakku.jar --debug export
|
||||
|
||||
- name: 📁 Move files
|
||||
run: |
|
||||
ls
|
||||
mkdir -p .pakku/multimc-overrides/flame
|
||||
mv -vf ./build/.cache/curseforge/manifest.json .pakku/multimc-overrides/flame/manifest.json
|
||||
mv -vf ./build/.cache/curseforge/overrides .pakku/multimc-overrides/.minecraft
|
||||
mv -vf ./mods .pakku/multimc-overrides/.minecraft/mods
|
||||
cd .pakku/multimc-overrides/
|
||||
|
||||
zip -r ${{ needs.info.outputs.project_full_name }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/
|
||||
|
||||
- name: 🚀 Upload zip multimc
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-multimc
|
||||
path: .pakku/multimc-overrides/${{ needs.info.outputs.project_full_name }}-multimc.zip
|
||||
if-no-files-found: error
|
||||
|
||||
release-curseforge:
|
||||
name: 🚀 Release to CurseForge
|
||||
needs: [info, build-modpack, build-server]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
id: ${{ steps.release.outputs.id }}
|
||||
|
||||
steps:
|
||||
- name: 🔒 Check if CURSEFORGE_TOKEN exist
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ secrets.CURSEFORGE_TOKEN }}" == '' ]; then
|
||||
echo '::error::No value found for secret key `CURSEFORGE_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
|
||||
fi
|
||||
|
||||
- name: 📦 Download artifact curseforge
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-curseforge
|
||||
|
||||
- name: 📦 Download artifact server
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_full_name }}-serverpack
|
||||
|
||||
- name: 🚀 Upload Curseforge
|
||||
id: release
|
||||
uses: Xikaro/upload-curseforge-modpack-action@1.1.1
|
||||
with:
|
||||
api-token: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||
project-id: ${{ vars.CURSEFORGE_ID }}
|
||||
display-name: ${{ needs.info.outputs.project_full_name }}
|
||||
modpack-path: ${{ needs.info.outputs.project_full_name }}-curseforge.zip
|
||||
server-display-name: ${{ needs.info.outputs.project_full_name }}-serverpack
|
||||
modpack-server-path: ${{ needs.info.outputs.project_full_name }}-serverpack.zip
|
||||
changelog: |
|
||||
${{ needs.info.outputs.changelog }}
|
||||
${{ needs.info.outputs.diff }}
|
||||
changelog-format: markdown
|
||||
game-version: ${{ needs.info.outputs.minecraft_version }}
|
||||
release-type: ${{ needs.info.outputs.release_type }}
|
||||
|
||||
# release-modrinth:
|
||||
# name: 🚀 Release to Modrinth
|
||||
# needs: [info, build-modpack, build-server]
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# steps:
|
||||
# - name: 🔒 Check if MODRINTH_API_TOKEN exist
|
||||
# shell: bash
|
||||
# run: |
|
||||
# if [ "${{ secrets.MODRINTH_TOKEN }}" == '' ]; then
|
||||
# echo '::error::No value found for secret key `MODRINTH_TOKEN`. See https://docs.github.com/en/ actionssecurity-guides/ encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
|
||||
# fi
|
||||
|
||||
# - name: 📦 Download artifact modrinth
|
||||
# uses: actions/download-artifact@v4.1.8
|
||||
# with:
|
||||
# name: ${{ needs.info.outputs.project_full_name }}-modrinth
|
||||
|
||||
# - name: 📦 Download artifact server
|
||||
# uses: actions/download-artifact@v4.1.8
|
||||
# with:
|
||||
# name: ${{ needs.info.outputs.project_full_name }}-serverpack
|
||||
|
||||
# - name: 🚀 Upload Modrinth
|
||||
# id: release
|
||||
# uses: Xikaro/upload-curseforge-modpack-action@1.1.1
|
||||
# with:
|
||||
# api-token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
# project-id: ${{ vars.MODRINTH_ID }}
|
||||
# modpack-path: ${{ needs.info.outputs.project_full_name }}-modrinth.mrpack
|
||||
# modpack-server-path: ${{ needs.info.outputs.project_full_name }}-serverpack.zip
|
||||
# changelog: ${{ needs.info.outputs.changelog }}
|
||||
# changelog-format: markdown
|
||||
# game-version: ${{ needs.info.outputs.minecraft_version }}
|
||||
# display-name: ${{ needs.info.outputs.project_full_name }}
|
||||
# server-display-name: ${{ needs.info.outputs.project_full_name }}-serverpack
|
||||
# release-type: ${{ needs.info.outputs.release_type }}
|
||||
|
||||
release-github:
|
||||
name: 🚀 Release to GitHub
|
||||
needs: [info, build-modpack, build-server, build-multimc]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
url: ${{ steps.release.outputs.url }}
|
||||
|
||||
steps:
|
||||
- name: 📦 Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: 📦 Download artifact
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
merge-multiple: true
|
||||
|
||||
- name: 🚫 Сlose fixed in dev
|
||||
uses: Xikaro/close-issues-based-on-label@master
|
||||
env:
|
||||
LABEL: "2. Status: In Dev"
|
||||
COMMENT: In ${{ needs.info.outputs.project_version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Format diff
|
||||
id: format_diff
|
||||
run: |
|
||||
if [ -n "${{ needs.info.outputs.diff }}" ]; then
|
||||
value="```markdown
|
||||
${{ needs.info.outputs.diff }}
|
||||
```"
|
||||
else
|
||||
value=""
|
||||
fi
|
||||
echo "value=${formatted_diff}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 🚀 Create release
|
||||
id: release
|
||||
uses: softprops/action-gh-release@v2.2.0
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_version }}
|
||||
tag_name: ${{ needs.info.outputs.project_version }}
|
||||
body: |
|
||||
${{ needs.info.outputs.changelog }}
|
||||
${{ steps.format_diff.outputs.value }}
|
||||
files: |
|
||||
${{ needs.info.outputs.project_full_name }}-curseforge.zip
|
||||
${{ needs.info.outputs.project_full_name }}-serverpack.zip
|
||||
${{ needs.info.outputs.project_full_name }}-multimc.zip
|
||||
prerelease: ${{ needs.info.outputs.release_type != 'release' }}
|
||||
generate_release_notes: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
discord-message:
|
||||
name: 📱 Discord Message
|
||||
needs: [info, release-curseforge, release-github]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: ✂️ Truncate Changelog
|
||||
id: truncated
|
||||
uses: cisox/read-more-action@v1.0.2
|
||||
with:
|
||||
text: '${{ needs.info.outputs.changelog }}'
|
||||
max_chars: '1450'
|
||||
|
||||
- name: 📨 Send Discord message
|
||||
uses: hugoalh/send-discord-webhook-ghaction@v7.0.3
|
||||
with:
|
||||
key: ${{ secrets.DISCORD_RELEASES }}
|
||||
username: "TerraFirmaGreg"
|
||||
avatar_url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo.png"
|
||||
content_links_no_embed: .+
|
||||
content: |
|
||||
**Release**: `${{ needs.info.outputs.project_version }}`
|
||||
**Release Type**: `${{ needs.info.outputs.release_type }}`
|
||||
**Game Version**: `${{ needs.info.outputs.minecraft_version }}`
|
||||
|
||||
[CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg-modern/files/${{ needs.release-curseforge.outputs.id }}) • [GitHub](${{ needs.release-github.outputs.url }}) • [Issues](https://github.com/${{ github.repository }}/issues)
|
||||
```markdown
|
||||
${{ steps.truncated.outputs.text }}
|
||||
- ...```
|
||||
** [Read more...](${{ needs.release-github.outputs.url }}) **
|
||||
23
.github/workflows/cron.yml
vendored
23
.github/workflows/cron.yml
vendored
|
|
@ -1,23 +0,0 @@
|
|||
name: Close Not a TFG Bug issues
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
name: Close issues
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/stale@v9.0.0
|
||||
with:
|
||||
days-before-issue-stale: 30
|
||||
days-before-issue-close: 14
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
any-of-issue-labels: '1. Type: Not a TFG Bug'
|
||||
stale-issue-label: '2. Status: Stale'
|
||||
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
298
.github/workflows/release.yml
vendored
298
.github/workflows/release.yml
vendored
|
|
@ -1,298 +0,0 @@
|
|||
name: Build
|
||||
run-name: "Build #${{ github.run_number }}"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*.*.*"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RELEASE_TYPE: "RELEASE"
|
||||
|
||||
jobs:
|
||||
info:
|
||||
name: Project Info
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
project_version: ${{ steps.project_version.outputs.tag }}
|
||||
project_name: ${{ steps.project_name.outputs.value }}
|
||||
mc_version: ${{ steps.mc_version.outputs.value }}
|
||||
changelog: ${{ steps.changelog.outputs.description }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Get tag
|
||||
id: project_version
|
||||
uses: "WyriHaximus/github-action-get-previous-tag@v1.4.0"
|
||||
with:
|
||||
fallback: build.${{ github.run_number }}
|
||||
|
||||
- name: Get project name
|
||||
id: project_name
|
||||
uses: ActionsTools/read-json-action@main
|
||||
with:
|
||||
file_path: ".github/buildtools/modpack/manifest.json"
|
||||
prop_path: "name"
|
||||
|
||||
- name: Get project name
|
||||
id: mc_version
|
||||
uses: ActionsTools/read-json-action@main
|
||||
with:
|
||||
file_path: ".github/buildtools/modpack/manifest.json"
|
||||
prop_path: "minecraft.version"
|
||||
|
||||
- name: Changelog Parser
|
||||
id: changelog
|
||||
uses: coditory/changelog-parser@v1.0.2
|
||||
with:
|
||||
path: CHANGELOG.md
|
||||
|
||||
build-curseforge:
|
||||
name: Build CurseForge Pack
|
||||
runs-on: ubuntu-latest
|
||||
needs: [info]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Replace strings
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=${{ needs.info.outputs.project_version }}
|
||||
sed -i -e "s/DEV/${VERSION}/g" ./.github/buildtools/modpack/manifest.json
|
||||
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt
|
||||
|
||||
- name: Export CurseForge
|
||||
run: |
|
||||
mkdir -p overrides
|
||||
mv -vf {config,defaultconfigs,kubejs} overrides/
|
||||
mv -vf .github/buildtools/modpack/manifest.json ./
|
||||
mv -vf .github/buildtools/modpack/modlist.html ./
|
||||
zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip manifest.json modlist.html overrides
|
||||
|
||||
- name: Upload zip CurseForge
|
||||
uses: actions/upload-artifact@v4.5.0
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge
|
||||
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
|
||||
retention-days: 5
|
||||
|
||||
build-multimc:
|
||||
name: Build MultiMC Pack
|
||||
runs-on: ubuntu-latest
|
||||
needs: [info]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Replace strings
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=${{ needs.info.outputs.project_version }}
|
||||
sed -i -e "s/DEV/${VERSION}/g" ./.github/buildtools/modpack/instance.cfg
|
||||
sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/gui_main_menu.txt
|
||||
|
||||
- name: Download Mods
|
||||
run: |
|
||||
git submodule init
|
||||
cd mods
|
||||
git config --global credential.helper '!f() {
|
||||
echo "username=Xikaro";
|
||||
echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
|
||||
git submodule update --recursive
|
||||
|
||||
- name: Export MultiMC
|
||||
run: |
|
||||
mkdir -p .minecraft
|
||||
mkdir -p flame
|
||||
mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/
|
||||
mv -vf .github/buildtools/modpack/mmc-pack.json ./
|
||||
mv -vf .github/buildtools/modpack/instance.cfg ./
|
||||
mv -vf .github/buildtools/modpack/modlist.html ./
|
||||
mv -vf .github/buildtools/modpack/manifest.json flame/
|
||||
find .minecraft/mods -name "probejs-*" -delete;
|
||||
find .minecraft/mods -name ".git" -delete;
|
||||
zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/
|
||||
|
||||
- name: Upload zip multimc
|
||||
uses: actions/upload-artifact@v4.5.0
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc
|
||||
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip
|
||||
retention-days: 5
|
||||
|
||||
build-server:
|
||||
name: Build Server Pack
|
||||
runs-on: ubuntu-latest
|
||||
needs: [info]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Download Mods
|
||||
run: |
|
||||
git submodule init
|
||||
cd mods
|
||||
git config --global credential.helper '!f() {
|
||||
echo "username=Xikaro";
|
||||
echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f'
|
||||
git submodule update --recursive
|
||||
|
||||
- name: Export serverpack
|
||||
run: |
|
||||
mkdir -p .minecraft
|
||||
mv -vf {config,defaultconfigs,kubejs,mods,.github/buildtools/serverpack/*} .minecraft
|
||||
cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done
|
||||
zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip .minecraft/*
|
||||
|
||||
- name: Upload zip
|
||||
uses: actions/upload-artifact@v4.5.0
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
|
||||
path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
|
||||
retention-days: 5
|
||||
|
||||
release-curseforge:
|
||||
name: Deploy to CurseForge
|
||||
needs: [info, build-curseforge, build-server]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cf_release_id: ${{ steps.cf_release.outputs.id }}
|
||||
steps:
|
||||
- name: Check if CF_API_TOKEN exist
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then
|
||||
echo '::error::No value found for secret key `CF_API_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
|
||||
fi
|
||||
|
||||
- name: Download cf modpack
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge
|
||||
|
||||
- name: Download serverpack
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
|
||||
|
||||
- name: Upload Curseforge
|
||||
id: cf_release
|
||||
uses: Xikaro/upload-curseforge-modpack-action@1.1.1
|
||||
with:
|
||||
api-token: ${{ secrets.CF_API_TOKEN }}
|
||||
project-id: ${{ vars.CF_MODPACK_ID }}
|
||||
display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}
|
||||
modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
|
||||
server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
|
||||
modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
|
||||
changelog: ${{ needs.info.outputs.changelog }}
|
||||
changelog-format: markdown
|
||||
game-version: ${{ needs.info.outputs.mc_version }}
|
||||
release-type: ${{ env.RELEASE_TYPE }}
|
||||
|
||||
# release-modrinth:
|
||||
# name: Deploy to Modrinth
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Check if MODRINTH_API_TOKEN exist
|
||||
# shell: bash
|
||||
# run: |
|
||||
# if [ "${{ secrets.MODRINTH_API_TOKEN }}" == '' ]; then
|
||||
# echo '::error::No value found for secret key `MODRINTH_API_TOKEN`. See https://docs.github.com/en/ actionssecurity-guides/ encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1
|
||||
# fi
|
||||
|
||||
# - name: Download modpack
|
||||
# uses: actions/download-artifact@v4.1.0
|
||||
# with:
|
||||
# name: modpack_mrd
|
||||
|
||||
# - name: Download serverpack
|
||||
# uses: actions/download-artifact@v4.1.0
|
||||
# with:
|
||||
# name: server_pack
|
||||
|
||||
# - name: Upload Modrinth
|
||||
# id: cf_release
|
||||
# uses: SwitchAlpha/upload-curseforge-modpack-action@master
|
||||
# with:
|
||||
# api-token: ${{ secrets.MODRINTH_API_TOKEN }}
|
||||
# project-id: ${{ vars.MODRINTH_MODPACK_ID }}
|
||||
# modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-mrd.zip
|
||||
# modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
|
||||
# changelog: ${{ needs.info.outputs.changelog }}
|
||||
# changelog-format: markdown
|
||||
# game-version: ${{ needs.info.outputs.mc_version }}
|
||||
# display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}
|
||||
# server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server
|
||||
# release-type: ${{ env.RELEASE_TYPE }}
|
||||
|
||||
close-fixed-issues:
|
||||
name: Close Fixed Issues
|
||||
needs: [info, build-curseforge, build-multimc, build-server]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Сlose fixed in dev
|
||||
uses: Xikaro/close-issues-based-on-label@master
|
||||
env:
|
||||
LABEL: "2. Status: In Dev"
|
||||
COMMENT: In ${{ needs.info.outputs.project_version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
release-github:
|
||||
name: Deploy to GitHub
|
||||
needs: [info, build-curseforge, build-multimc, build-server, close-fixed-issues]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download modpack
|
||||
uses: actions/download-artifact@v4.1.8
|
||||
with:
|
||||
merge-multiple: true
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
name: ${{ needs.info.outputs.project_version }}
|
||||
body: ${{ needs.info.outputs.changelog }}
|
||||
files: |
|
||||
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip
|
||||
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip
|
||||
${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-server.zip
|
||||
tag_name: ${{ needs.info.outputs.project_version }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
discord-message:
|
||||
name: Discord Message
|
||||
needs: [info, release-github, release-curseforge]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send Discord message
|
||||
uses: tsickert/discord-webhook@v6.0.0
|
||||
with:
|
||||
webhook-url: ${{secrets.RELEASES_1_20}}
|
||||
username: "TerraFirmaGreg"
|
||||
avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/curseforge.png"
|
||||
embed-title: Release ${{ needs.info.outputs.project_version }}
|
||||
embed-url: https://github.com/${{ github.repository }}/releases/tag/${{ needs.info.outputs.project_version }}
|
||||
embed-thumbnail-url: https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo.png
|
||||
embed-description: |
|
||||
**Release Type**: `${{ env.RELEASE_TYPE }}`
|
||||
**GameVersion**: `${{ needs.info.outputs.mc_version }}`
|
||||
**Website Link**: [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ needs.release-curseforge.outputs.cf_release_id }})
|
||||
|
||||
** Сhangelog **
|
||||
```${{ needs.info.outputs.changelog }}```
|
||||
** [More details...](https://github.com/TerraFirmaGreg-Team/Modpack-Modern/blob/main/CHANGELOG.md) **
|
||||
embed-color: 5814783
|
||||
26
.github/workflows/server.yml
vendored
Normal file
26
.github/workflows/server.yml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: Project Server News
|
||||
run-name: "Project Server News #${{ github.run_number }}"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
project_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
discord-message:
|
||||
name: 📱 Discord Message
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📨 Send Discord message
|
||||
uses: hugoalh/send-discord-webhook-ghaction@v7.0.3
|
||||
with:
|
||||
key: ${{ secrets.DISCORD_NEWS_SERVER }}
|
||||
username: "TerraFirmaGreg"
|
||||
avatar_url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo.png"
|
||||
content_links_no_embed: .+
|
||||
allowed_mentions_parse_users: true
|
||||
content: |
|
||||
@Xikaro
|
||||
**Server updated to**: `${{ inputs.project_version }}`
|
||||
Loading…
Add table
Add a link
Reference in a new issue