53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Multi-Pack Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- "smp/v*"
|
|
- "creative/v*"
|
|
- "client/v*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Identify Pack
|
|
id: vars
|
|
run: |
|
|
TAG=${GITHUB_REF#refs/tags/}
|
|
# Extracts 'smp' from 'smp/v1.0.0'
|
|
PACK_NAME=${TAG%/*}
|
|
echo "pack_name=$PACK_NAME" >> $GITHUB_OUTPUT
|
|
|
|
# Determine the directory path based on the prefix
|
|
if [ "$PACK_NAME" = "smp" ]; then
|
|
echo "path=server/smp" >> $GITHUB_OUTPUT
|
|
elif [ "$PACK_NAME" = "creative" ]; then
|
|
echo "path=server/creative" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "path=client" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: "${{ steps.vars.outputs.pack_name }} ${{ github.ref_name }}"
|
|
body: "Packwiz update for ${{ steps.vars.outputs.pack_name }}."
|
|
|
|
- name: Upload pack.toml
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
# Points to the specific directory's pack.toml
|
|
asset_path: ./${{ steps.vars.outputs.path }}/pack.toml
|
|
asset_name: pack.toml
|
|
asset_content_type: text/x-toml
|