modpack-template/.github/workflows/release.yml

76 lines
2.2 KiB
YAML
Raw Normal View History

name: Build Project
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '16' # Change to '8' for Java 8
- name: Install BusyBox and 7z
run: |
sudo apt-get update
sudo apt-get install -y busybox p7zip-full
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 'latest' # Always use the latest Go version
- name: Update Packwiz
run: make update-packwiz
- name: Make Modpack
run: make preClean multimc curseforge modrinth postClean
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload MultiMC Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/*-multimc.zip
asset_name: multimc.zip
asset_content_type: application/zip
- name: Upload CurseForge Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/*-curseforge.zip
asset_name: curseforge.zip
asset_content_type: application/zip
- name: Upload Modrinth Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .build/*-modrinth.mrpack
asset_name: modrinth.mrpack
asset_content_type: application/octet-stream