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
75 changes: 44 additions & 31 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
name: Test Release

# Add a concurrency group incase a tag is created, deleted, and then recreated while a release is in progress.
# Add a concurrency group incase a release is triggered multiple times
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Only run this workflow when a tag is pushed when the tag starts with "v".
# Manual trigger with inputs for version and optional dalamud branch
on:
push:
tags:
- "testing_v*"
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.0.0)'
required: true
type: string
dalamud_branch:
description: 'Dalamud branch/path (optional, leave empty for latest)'
required: false
type: string

# So we can use the GitHub API to create releases with the run token.
permissions:
contents: write

jobs:
TestRelease:
if: github.event.pull_request.draft == false # Ignore draft PRs
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -26,6 +32,8 @@ jobs:
env:
DALAMUD_HOME: /tmp/dalamud
IsCI: true
VERSION: ${{ github.event.inputs.version }}
DOWNLOAD_PATH: ${{ github.event.inputs.dalamud_branch }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -37,27 +45,11 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Extract version and custom path
- name: Display build information
run: |
tag=${{ github.ref_name }}

# Check if tag matches the custom branch pattern (testing_v{version}_{custom_path})
if [[ $tag =~ ^testing_v(.+)_(.+)$ ]]; then
version="${BASH_REMATCH[1]}"
download_path="${BASH_REMATCH[2]}"
# Check if tag matches the default pattern (testing_v{version})
elif [[ $tag =~ ^testing_v(.+)$ ]]; then
version="${BASH_REMATCH[1]}"
download_path=""
else
echo "Tag format not recognized"
exit 1
fi

echo "VERSION=$version" >> $GITHUB_ENV
echo "DOWNLOAD_PATH=$download_path" >> $GITHUB_ENV
echo "Download Path: $download_path"
echo "Version: $version"
echo "Building version: ${{ env.VERSION }}"
echo "Dalamud branch/path: ${{ env.DOWNLOAD_PATH }}"
echo "Building on branch: ${{ github.ref_name }}"

- name: Download Dalamud Library
run: |
Expand Down Expand Up @@ -89,6 +81,8 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: testing_v${{ env.VERSION }}${{ env.DOWNLOAD_PATH && format('_{0}', env.DOWNLOAD_PATH) || '' }}
name: Test Release v${{ env.VERSION }}${{ env.DOWNLOAD_PATH && format(' ({0})', env.DOWNLOAD_PATH) || '' }}
files: |
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/latest.zip
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/checksums.sha512
Expand All @@ -106,16 +100,29 @@ jobs:
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/latest.zip
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/checksums.sha512

- name: Update repo.json
- name: Checkout main branch to update repo.json
uses: actions/checkout@v4
with:
ref: main
path: main-branch
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update repo.json on main branch
run: |
cd ../../
cd ../../main-branch

repo_url="$(echo "${{ github.server_url }}/${{ github.repository }}" | sed 's/#/\\#/g')"
echo "Repo URL: $repo_url"

# Create tag name with optional dalamud branch suffix
tag_name="testing_v${{ env.VERSION }}"
if [ ! -z "${{ env.DOWNLOAD_PATH }}" ]; then
tag_name="${tag_name}_${{ env.DOWNLOAD_PATH }}"
fi

# Update the JSON file using jq
jq --arg version "${{ env.VERSION }}" \
--arg repo_url "$repo_url/releases/download/${{ github.ref_name }}/latest.zip" \
--arg repo_url "$repo_url/releases/download/$tag_name/latest.zip" \
'.[0].TestingAssemblyVersion = $version |
.[0].DownloadLinkTesting = $repo_url' \
repo.json > tmp.json && mv tmp.json repo.json
Expand All @@ -125,6 +132,12 @@ jobs:
git add repo.json
git config --local user.name "github-actions [bot]"
git config --local user.email "[email protected]"
git commit -m "Update repo.json for ${{ github.ref_name }}"

git push origin HEAD:main
# Create commit message with optional dalamud branch info
commit_msg="Update repo.json for testing release v${{ env.VERSION }}"
if [ ! -z "${{ env.DOWNLOAD_PATH }}" ]; then
commit_msg="${commit_msg} (${{ env.DOWNLOAD_PATH }})"
fi

git commit -m "$commit_msg"
git push origin main
8 changes: 4 additions & 4 deletions Meddle/Meddle.Plugin/Meddle.Plugin.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
<Project Sdk="Dalamud.NET.Sdk/13.1.0">
<PropertyGroup>
<Version>0.0.1</Version>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -9,9 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="Vortice.Direct3D11" Version="3.5.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
<PackageReference Include="Vortice.Direct3D11" Version="3.6.2" />
<Reference Include="OtterTex">
<HintPath>..\Meddle.Utils\Lib\OtterTex.dll</HintPath>
</Reference>
Expand Down
4 changes: 2 additions & 2 deletions Meddle/Meddle.Plugin/Models/Composer/ComposerCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ string SaveColorTableTex(SkTexture tex)

if (characterInfo != null)
{
if (characterInfo.CustomizeData.DecalPath != null)
if (characterInfo.CustomizeData?.DecalPath != null)
{
var decalCachePath = CacheTexture(characterInfo.CustomizeData.DecalPath);
material.SetProperty("Decal_PngCachePath", Path.GetRelativePath(cacheDir, decalCachePath));
}

if (characterInfo.CustomizeData.LegacyBodyDecalPath != null)
if (characterInfo.CustomizeData?.LegacyBodyDecalPath != null)
{
var legacyDecalCachePath = CacheTexture(characterInfo.CustomizeData.LegacyBodyDecalPath);
material.SetProperty("LegacyBodyDecal_PngCachePath", Path.GetRelativePath(cacheDir, legacyDecalCachePath));
Expand Down
Loading