Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/GH ACTIONS README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# GitHub Actions Workflows

This repository contains GitHub Actions workflows for automated building and publishing of the Alien Departure Lounge modpack.

## Workflows

### 1. `build-on-push.yml` - Build ZIP on Push
- **Triggers**: Push to `main` or `staging` branches, or pull requests
- **Purpose**: Creates ZIP artifacts for testing and development
- **Retention**: 30 days
- **Output**: Downloadable artifacts in Actions tab

### 2. `release-build.yml` - Full Release
- **Triggers**: When a release is published (not pre-release)
- **Purpose**: Publishes stable releases to all platforms
- **Platforms**: GitHub, CurseForge, Modrinth
- **Release Type**: `release`

### 3. `beta-release.yml` - Beta Release
- **Triggers**: When a pre-release is published
- **Purpose**: Publishes beta versions to all platforms
- **Platforms**: GitHub, CurseForge, Modrinth
- **Release Type**: `beta`

## Required Secrets

To enable publishing to CurseForge and Modrinth, add these secrets to your repository:

### CurseForge Secrets
- `CURSEFORGE_TOKEN`: Your CurseForge API token
- `CURSEFORGE_PROJECT_ID`: Your CurseForge project ID

### Modrinth Secrets
- `MODRINTH_TOKEN`: Your Modrinth API token
- `MODRINTH_PROJECT_ID`: Your Modrinth project ID (slug)

## How to Add Secrets

1. Go to your GitHub repository
2. Click **Settings** → **Secrets and variables** → **Actions**
3. Click **New repository secret**
4. Add each secret with its corresponding value

## Release Process

### For Stable Releases
1. Create a new release in GitHub
2. Use version tags like `v1.0.0` (must start with 'v')
3. **Do NOT check "This is a pre-release"**
4. Fill in release notes
5. Click "Publish release"

### For Beta Releases
1. Create a new release in GitHub
2. Use version tags like `v1.0.0-beta1`
3. **Check "This is a pre-release"**
4. Fill in release notes
5. Click "Publish release"

## Features

- ✅ Automatic ZIP creation with proper exclusions
- ✅ Version synchronization between Git tags and manifest.json
- ✅ Multi-platform publishing (GitHub, CurseForge, Modrinth)
- ✅ Separate workflows for stable and beta releases
- ✅ Conditional publishing (only if tokens are configured)
- ✅ Proper Minecraft version and mod loader tagging
79 changes: 79 additions & 0 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Beta Release to Platforms

on:
release:
types: [prereleased]

jobs:
beta-release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get release info
id: release_info
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "release_name=${{ github.event.release.name }}" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Update manifest version
run: |
# Update the version in manifest.json to match the release tag
sed -i 's/"version": ".*"/"version": "${{ steps.release_info.outputs.version }}"/' manifest.json

- name: Create ZIP archive
run: |
# Create zip excluding .git directory and other unnecessary files
zip -r "ADLPack-${{ steps.release_info.outputs.tag_name }}.zip" . \
-x ".git/*" ".github/*" "*.git*" "STAGING.md" "*.log" "*.tmp"

- name: Upload ZIP to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
asset_name: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
asset_content_type: application/zip

- name: Upload beta to CurseForge
if: ${{ env.CURSEFORGE_TOKEN != '' }}
uses: itsmeow/curseforge-upload@v3
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
with:
token: ${{ secrets.CURSEFORGE_TOKEN }}
project_id: ${{ secrets.CURSEFORGE_PROJECT_ID }}
game_endpoint: minecraft
file_path: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
changelog: ${{ github.event.release.body }}
display_name: "Alien Departure Lounge ${{ steps.release_info.outputs.version }} (Beta)"
game_versions: "1.20.1,Forge"
release_type: beta

- name: Upload beta to Modrinth
if: ${{ env.MODRINTH_TOKEN != '' }}
uses: Kir-Antipov/mc-publish@v3.3
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_PROJECT_ID: ${{ secrets.MODRINTH_PROJECT_ID }}
with:
modrinth-id: ${{ secrets.MODRINTH_PROJECT_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
name: "Alien Departure Lounge ${{ steps.release_info.outputs.version }} (Beta)"
version: ${{ steps.release_info.outputs.version }}
changelog: ${{ github.event.release.body }}

game-versions: |
1.20.1
loaders: |
forge

version-type: beta
35 changes: 35 additions & 0 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build ZIP on Push

on:
push:
branches: [ main, staging ]
pull_request:
branches: [ main, staging ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get commit info
id: commit_info
run: |
echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "timestamp=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT

- name: Create ZIP archive
run: |
# Create zip excluding .git directory and other unnecessary files
zip -r "ADLPack-${{ steps.commit_info.outputs.branch_name }}-${{ steps.commit_info.outputs.short_sha }}.zip" . \
-x ".git/*" ".github/*" "*.git*" "STAGING.md" "*.log" "*.tmp"

- name: Upload ZIP as artifact
uses: actions/upload-artifact@v4
with:
name: ADLPack-${{ steps.commit_info.outputs.branch_name }}-${{ steps.commit_info.outputs.short_sha }}
path: ADLPack-${{ steps.commit_info.outputs.branch_name }}-${{ steps.commit_info.outputs.short_sha }}.zip
retention-days: 30
79 changes: 79 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Release to All Platforms

on:
release:
types: [published]

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get release info
id: release_info
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "release_name=${{ github.event.release.name }}" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Update manifest version
run: |
# Update the version in manifest.json to match the release tag
sed -i 's/"version": ".*"/"version": "${{ steps.release_info.outputs.version }}"/' manifest.json

- name: Create ZIP archive
run: |
# Create zip excluding .git directory and other unnecessary files
zip -r "ADLPack-${{ steps.release_info.outputs.tag_name }}.zip" . \
-x ".git/*" ".github/*" "*.git*" "STAGING.md" "*.log" "*.tmp"

- name: Upload ZIP to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
asset_name: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
asset_content_type: application/zip

- name: Upload to CurseForge
if: ${{ env.CURSEFORGE_TOKEN != '' }}
uses: itsmeow/curseforge-upload@v3
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
with:
token: ${{ secrets.CURSEFORGE_TOKEN }}
project_id: ${{ secrets.CURSEFORGE_PROJECT_ID }}
game_endpoint: minecraft
file_path: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
changelog: ${{ github.event.release.body }}
display_name: "Alien Departure Lounge ${{ steps.release_info.outputs.version }}"
game_versions: "1.20.1,Forge"
release_type: release

- name: Upload to Modrinth
if: ${{ env.MODRINTH_TOKEN != '' }}
uses: Kir-Antipov/mc-publish@v3.3
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_PROJECT_ID: ${{ secrets.MODRINTH_PROJECT_ID }}
with:
modrinth-id: ${{ secrets.MODRINTH_PROJECT_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: ADLPack-${{ steps.release_info.outputs.tag_name }}.zip
name: "Alien Departure Lounge ${{ steps.release_info.outputs.version }}"
version: ${{ steps.release_info.outputs.version }}
changelog: ${{ github.event.release.body }}

game-versions: |
1.20.1
loaders: |
forge

version-type: release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.zip
Loading
Loading