Skip to content

Commit 07a880f

Browse files
committed
compile workflow changes
1 parent 26135f3 commit 07a880f

2 files changed

Lines changed: 59 additions & 36 deletions

File tree

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,61 @@
11
name: Compile Modpack
2+
description: Compiles the Star Technology modpack into a distributable zip file
23

3-
on:
4-
push:
5-
branches: [ "*" ]
6-
pull_request:
7-
branches: [ "*" ]
4+
inputs:
5+
branch_name:
6+
description: Branch name used for naming the output artifact
7+
required: true
88

9-
jobs:
10-
compile:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
16-
17-
- name: Get branch name
18-
id: branch
19-
run: |
20-
if [ "${{ github.event_name }}" == "pull_request" ]; then
21-
echo "branch_name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
22-
else
23-
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
24-
fi
25-
9+
runs:
10+
using: composite
11+
steps:
2612
- name: Create compilation directory
13+
shell: bash
2714
run: mkdir -p compile_output
28-
15+
2916
- name: Create overrides directory structure
17+
shell: bash
3018
run: |
3119
mkdir -p compile_output/overrides
32-
20+
3321
# Copy specified folders to overrides
3422
cp -r config compile_output/overrides/
3523
cp -r defaultconfigs compile_output/overrides/
3624
cp -r kubejs compile_output/overrides/
3725
cp -r packmode compile_output/overrides/
3826
cp -r scripts compile_output/overrides/
39-
27+
4028
# Copy specified files to overrides
4129
cp LICENSE compile_output/overrides/
4230
cp packmode_picker.py compile_output/overrides/
4331
cp packmode_picker.sh compile_output/overrides/
4432
cp README.md compile_output/overrides/
45-
33+
4634
- name: Copy manifest and modlist from compile_data
35+
shell: bash
4736
run: |
4837
cp compile_data/manifest.json compile_output/
4938
cp compile_data/modlist.html compile_output/
50-
39+
5140
- name: Create zip file
41+
shell: bash
5242
run: |
5343
cd compile_output
54-
zip -r "../Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}.zip" .
44+
zip -r "../Star Technology-1.20.1-${{ inputs.branch_name }}.zip" .
5545
cd ..
56-
46+
5747
- name: Upload compiled modpack
5848
uses: actions/upload-artifact@v4
5949
with:
60-
name: Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}
61-
path: Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}.zip
50+
name: Star Technology-1.20.1-${{ inputs.branch_name }}
51+
path: Star Technology-1.20.1-${{ inputs.branch_name }}.zip
6252
retention-days: 30
63-
53+
6454
- name: Display compilation info
55+
shell: bash
6556
run: |
6657
echo "✅ Modpack compiled successfully!"
67-
echo "📦 Artifact name: Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}"
68-
echo "🏷️ Branch: ${{ steps.branch.outputs.branch_name }}"
69-
echo "📁 Zip file: Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}.zip"
70-
ls -la "Star Technology-1.20.1-${{ steps.branch.outputs.branch_name }}.zip"
58+
echo "📦 Artifact name: Star Technology-1.20.1-${{ inputs.branch_name }}"
59+
echo "🏷️ Branch: ${{ inputs.branch_name }}"
60+
echo "📁 Zip file: Star Technology-1.20.1-${{ inputs.branch_name }}.zip"
61+
ls -la "Star Technology-1.20.1-${{ inputs.branch_name }}.zip"

.github/workflows/compile.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 }}

0 commit comments

Comments
 (0)