From 88c9135f40f077419692d42c9f5a1d89a3dafaa4 Mon Sep 17 00:00:00 2001 From: themodrnhakr Date: Fri, 6 Mar 2026 18:06:41 -0600 Subject: [PATCH] Add automated release actions. --- .gitea/workflows/release.yaml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..0fe3904 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,52 @@ +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