Skip to content

Commit f579062

Browse files
committed
Feat(Experiment-1): GitHub Action Build/Publish.
1 parent 1fa5842 commit f579062

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/remotelymod-cloud.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,27 @@ jobs:
7979
chmod +x gradlew
8080
./gradlew jar --no-daemon --stacktrace
8181
82-
- name: Build or publish RemotelyMod
82+
- name: Ensure version project directories
83+
working-directory: Remotely/RemotelyMod
84+
run: |
85+
chmod +x scripts/ensure-version-project-dirs.sh
86+
./scripts/ensure-version-project-dirs.sh
87+
88+
- name: Build all RemotelyMod versions
89+
working-directory: Remotely/RemotelyMod
90+
run: |
91+
chmod +x gradlew
92+
./gradlew buildAllVersions --no-daemon --stacktrace
93+
94+
- name: Publish RemotelyMod
95+
if: startsWith(inputs.goal, 'publish')
8396
working-directory: Remotely/RemotelyMod
8497
env:
8598
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
8699
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
87100
run: |
88101
chmod +x gradlew
89-
if [[ "${{ inputs.goal }}" == buildAllVersions ]]; then
90-
./gradlew buildAllVersions --no-daemon --stacktrace
91-
else
92-
./gradlew buildAllVersions --no-daemon --stacktrace
93-
./gradlew ${{ inputs.goal }} --no-daemon --stacktrace
94-
fi
102+
./gradlew ${{ inputs.goal }} --no-daemon --stacktrace
95103
96104
- name: Upload mod jars
97105
uses: actions/upload-artifact@v4
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
root="$(cd "$(dirname "$0")/.." && pwd)"
4+
settings="$root/settings.gradle.kts"
5+
cd "$root"
6+
while IFS= read -r version; do
7+
mkdir -p "versions/$version"
8+
done < <(grep -E '^\s+"[0-9]' "$settings" | sed -E 's/^[[:space:]]*"([^"]+)".*/\1/')

0 commit comments

Comments
 (0)