Skip to content

Commit e3a9cc2

Browse files
authored
Merge branch 'StarT-Dev-Team:main' into main
2 parents f6058eb + a252783 commit e3a9cc2

1,559 files changed

Lines changed: 54073 additions & 150441 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ assignees: ''
88
---
99

1010
Modpack version:
11-
Packmode(default/hardmode/abydos):
1211
Minecraft version:
1312
Is on server:
1413
Modifications done:
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Compile Modpack
2+
description: Compiles the Star Technology modpack into a distributable zip file
3+
4+
inputs:
5+
branch_name:
6+
description: Branch name used for naming the output artifact
7+
required: true
8+
discord_webhook_url:
9+
description: Discord webhook URL for sending build notifications
10+
required: false
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Create compilation directory
16+
shell: bash
17+
run: mkdir -p compile_output
18+
19+
- name: Create overrides directory structure
20+
shell: bash
21+
run: |
22+
mkdir -p compile_output/overrides
23+
24+
# Copy specified folders to overrides
25+
cp -r config compile_output/overrides/
26+
cp -r defaultconfigs compile_output/overrides/
27+
cp -r kubejs compile_output/overrides/
28+
cp -r scripts compile_output/overrides/
29+
30+
# Copy specified files to overrides
31+
cp LICENSE compile_output/overrides/
32+
cp README.md compile_output/overrides/
33+
34+
- name: Copy manifest and modlist from compile_data
35+
shell: bash
36+
run: |
37+
cp compile_data/manifest.json compile_output/
38+
cp compile_data/modlist.html compile_output/
39+
40+
- name: Create zip file
41+
shell: bash
42+
run: |
43+
cd compile_output
44+
zip -r "../Star Technology-1.20.1-${{ inputs.branch_name }}.zip" .
45+
cd ..
46+
47+
- name: Upload compiled modpack
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: Star Technology-1.20.1-${{ inputs.branch_name }}
51+
path: Star Technology-1.20.1-${{ inputs.branch_name }}.zip
52+
retention-days: 30
53+
54+
- name: Send Discord notification
55+
shell: bash
56+
env:
57+
DISCORD_WEBHOOK_URL: ${{ inputs.discord_webhook_url }}
58+
run: |
59+
# Only send notification if webhook URL is provided
60+
if [ -z "$DISCORD_WEBHOOK_URL" ]; then
61+
echo "⚠️ Discord webhook URL not provided, skipping notification"
62+
exit 0
63+
fi
64+
65+
# Calculate expiry date (retention-days from now)
66+
EXPIRY_DATE=$(date -u -d "+30 days" "+%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || date -u -v+30d "+%Y-%m-%dT%H:%M:%SZ")
67+
EXPIRY_UNIX=$(date -u -d "+30 days" "+%s" 2>/dev/null || date -u -v+30d "+%s")
68+
69+
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
70+
ARTIFACT_NAME="Star Technology-1.20.1-${{ inputs.branch_name }}"
71+
72+
RESPONSE=$(curl -s -X POST "$DISCORD_WEBHOOK_URL" \
73+
-H "Content-Type: application/json" \
74+
-d "{
75+
\"embeds\": [{
76+
\"title\": \"✅ Build Ready: ${ARTIFACT_NAME}\",
77+
\"description\": \"A new build has been compiled and uploaded.\",
78+
\"color\": 5763719,
79+
\"fields\": [
80+
{
81+
\"name\": \"📦 Download Artifact\",
82+
\"value\": \"[View on GitHub Actions](${RUN_URL})\",
83+
\"inline\": false
84+
},
85+
{
86+
\"name\": \"⏳ Expires\",
87+
\"value\": \"<t:${EXPIRY_UNIX}:F> (<t:${EXPIRY_UNIX}:R>)\",
88+
\"inline\": false
89+
},
90+
{
91+
\"name\": \"🌿 Branch\",
92+
\"value\": \"\`${{ inputs.branch_name }}\`\",
93+
\"inline\": true
94+
},
95+
{
96+
\"name\": \"🔁 Run\",
97+
\"value\": \"[#${{ github.run_number }}](${RUN_URL})\",
98+
\"inline\": true
99+
}
100+
],
101+
\"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
102+
}]
103+
}" -w "\n%{http_code}")
104+
105+
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
106+
if [ "$HTTP_CODE" = "204" ]; then
107+
echo "✅ Discord notification sent successfully"
108+
else
109+
echo "❌ Failed to send Discord notification (HTTP $HTTP_CODE)"
110+
echo "Response: $(echo "$RESPONSE" | head -n-1)"
111+
exit 1
112+
fi
113+
114+
- name: Display compilation info
115+
shell: bash
116+
run: |
117+
echo "✅ Modpack compiled successfully!"
118+
echo "📦 Artifact name: Star Technology-1.20.1-${{ inputs.branch_name }}"
119+
echo "🏷️ Branch: ${{ inputs.branch_name }}"
120+
echo "📁 Zip file: Star Technology-1.20.1-${{ inputs.branch_name }}.zip"
121+
ls -la "Star Technology-1.20.1-${{ inputs.branch_name }}.zip"

.github/workflows/autocompile.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/compile.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Compile Modpack
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
types: [opened, synchronize, reopened, labeled]
10+
11+
jobs:
12+
compile:
13+
runs-on: ubuntu-latest
14+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'build')
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Get branch name
21+
id: branch
22+
run: |
23+
if [ "${{ github.event_name }}" == "pull_request" ]; then
24+
echo "branch_name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
25+
else
26+
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Compile modpack
30+
uses: ./.github/actions/compile-modpack
31+
with:
32+
branch_name: ${{ steps.branch.outputs.branch_name }}
33+
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}

0 commit comments

Comments
 (0)