Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9204fed54c | |||
| 406d0f5652 | |||
| 9cd651bdfe | |||
| 96336fd637 | |||
| e7d1b4b524 | |||
| a4d7269f8f | |||
| c7d741d15b | |||
| 6d2a6c5925 | |||
| 9ccb929553 | |||
| 5e086c0598 | |||
| a7c86289b3 | |||
| b2e851d765 | |||
| 1a1d7dec7c | |||
| 103da6abe8 | |||
| 5f2fdbac87 | |||
| e0ceb7d314 | |||
| 8df80eba3b | |||
| 77875110f0 |
@@ -24,13 +24,6 @@ jobs:
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||
|
||||
- name: Login to own image registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.penry.de
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Setup .NET10
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
@@ -42,8 +35,16 @@ jobs:
|
||||
-t gitea.penry.de/${{ env.REPO_LC }}:${{ env.VERSION }} \
|
||||
-t gitea.penry.de/${{ env.REPO_LC }}:latest \
|
||||
--label "org.opencontainers.image.source=https://gitea.penry.de/${{ github.repository }}" \
|
||||
--build-arg VERSION=${{ env.VERSION }} \
|
||||
.
|
||||
|
||||
- name: Login to own image registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.penry.de
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Push Images
|
||||
run: |
|
||||
docker push gitea.penry.de/${{ env.REPO_LC }}:${{ env.VERSION }}
|
||||
|
||||
@@ -14,6 +14,8 @@ jobs:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
@@ -28,62 +30,35 @@ jobs:
|
||||
- name: Build version
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
LAST_TAG=$(git describe --tags --abbrev=0)
|
||||
|
||||
git fetch --force --tags origin
|
||||
git fetch --force origin main:refs/remotes/origin/main
|
||||
if [[ -z "${LAST_TAG:-}" ]]; then
|
||||
echo "No tag found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LAST_TAG=$(git for-each-ref \
|
||||
--sort=-creatordate \
|
||||
--format='%(refname:strip=2)' \
|
||||
refs/tags/v* \
|
||||
| head -n 1)
|
||||
COMMIT_COUNT=$(git rev-list $LAST_TAG..HEAD --count)
|
||||
|
||||
if [[ -z "${LAST_TAG:-}" ]]; then
|
||||
echo "No tag found"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$LAST_TAG" == *-* ]]; then
|
||||
TEMP_LAST_TAG="${LAST_TAG%-*}"
|
||||
VERSION="${TEMP_LAST_TAG}-nightly.${COMMIT_COUNT}"
|
||||
else
|
||||
VERSION="${LAST_TAG}-nightly.${COMMIT_COUNT}"
|
||||
fi
|
||||
|
||||
LAST_COMMIT=$(git rev-list -n 1 "$LAST_TAG")
|
||||
DISTANCE=$(git rev-list --count --first-parent "${LAST_COMMIT}..origin/main")
|
||||
echo "LAST_TAG=$LAST_TAG" >> "$GITHUB_ENV"
|
||||
echo "COMMIT_COUNT=$COMMIT_COUNT" >> "$GITHUB_ENV"
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
BASE_VERSION="${LAST_TAG#v}"
|
||||
|
||||
if [[ "$BASE_VERSION" == *-* ]]; then
|
||||
VERSION="${BASE_VERSION}.${DISTANCE}"
|
||||
else
|
||||
VERSION="${BASE_VERSION}-nightly.${DISTANCE}"
|
||||
fi
|
||||
|
||||
echo "LAST_TAG=$LAST_TAG" >> "$GITHUB_ENV"
|
||||
echo "LAST_COMMIT=$LAST_COMMIT" >> "$GITHUB_ENV"
|
||||
echo "DISTANCE=$DISTANCE" >> "$GITHUB_ENV"
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
echo "Last tag: $LAST_TAG"
|
||||
echo "Last tag commit: $LAST_COMMIT"
|
||||
echo "Distance to origin/main: $DISTANCE"
|
||||
echo "Final version: $VERSION"
|
||||
|
||||
- name: Set .NET version variables
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
SEMVER="${VERSION}"
|
||||
BASE_NUMERIC=$(echo "$SEMVER" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
|
||||
BUILD_NO=$(echo "$SEMVER" | grep -oE '[0-9]+$' || echo "0")
|
||||
|
||||
echo "PACKAGE_VERSION=$SEMVER" >> "$GITHUB_ENV"
|
||||
echo "ASSEMBLY_VERSION=${BASE_NUMERIC}.0" >> "$GITHUB_ENV"
|
||||
echo "FILE_VERSION=${BASE_NUMERIC}.${BUILD_NO}" >> "$GITHUB_ENV"
|
||||
echo "INFORMATIONAL_VERSION=$SEMVER" >> "$GITHUB_ENV"
|
||||
echo "Last tag: $LAST_TAG"
|
||||
echo "Commit count: $COMMIT_COUNT"
|
||||
echo "Final version: $VERSION"
|
||||
|
||||
- name: Build Linux ARM64 Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
-t gitea.penry.de/${{ env.REPO_LC }}:nightly \
|
||||
--build-arg VERSION=${{ env.PACKAGE_VERSION }} \
|
||||
--build-arg VERSION=${{ env.VERSION }} \
|
||||
.
|
||||
|
||||
- name: Login to own image registry
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<MudCardMedia Image="@GlobalEntity.PicturePath" Height="400" Style="object-fit: contain;"/>
|
||||
</MudPaper>
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h5">@GlobalEntity.Title</MudText>
|
||||
<MudText Typo="Typo.h5" Style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@GlobalEntity.Title</MudText>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudTooltip Text="Add to shared List">
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
|
||||
//Picture
|
||||
private IBrowserFile? _pictureFile;
|
||||
private string _pictureBase64;
|
||||
private string? _pictureContentType;
|
||||
private string? _pictureExtension;
|
||||
|
||||
private class GlobalEntityFormModel
|
||||
{
|
||||
@@ -165,8 +168,11 @@
|
||||
using var ms = new MemoryStream();
|
||||
await stream.CopyToAsync(ms);
|
||||
|
||||
var base64 = Convert.ToBase64String(ms.ToArray());
|
||||
_imagePreview = $"data:{_pictureFile.ContentType};base64,{base64}";
|
||||
_pictureContentType = _pictureFile.ContentType;
|
||||
_pictureExtension = Path.GetExtension(_pictureFile.Name);
|
||||
|
||||
_pictureBase64 = Convert.ToBase64String(ms.ToArray());
|
||||
_imagePreview = $"data:{_pictureFile.ContentType};base64,{_pictureBase64}";
|
||||
}
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
@@ -191,13 +197,10 @@
|
||||
|
||||
try
|
||||
{
|
||||
string fileName = $"{Guid.NewGuid()}{Path.GetExtension(_pictureFile.Name)}";
|
||||
string fileName = $"{Guid.NewGuid()}{_pictureExtension}";
|
||||
string picturePath = Path.Combine("wwwroot", "Pictures", fileName);
|
||||
|
||||
await using (var fs = File.Create(picturePath))
|
||||
{
|
||||
await _pictureFile.OpenReadStream(maxAllowedSize: 10_000_000).CopyToAsync(fs);
|
||||
}
|
||||
await File.WriteAllBytesAsync(picturePath, Convert.FromBase64String(_pictureBase64));
|
||||
|
||||
var entity = new GlobalEntity
|
||||
{
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
private async Task OnNewEntity(GlobalEntity entity)
|
||||
{
|
||||
_globalEntities.Add(entity);
|
||||
_globalEntities.Insert(0, entity);
|
||||
await RefreshPage();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<MudStack Class="pa-3" Spacing="2">
|
||||
<!--<editor-fold desc="Options">-->
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.h6">@PrivateEntity.GlobalEntity.Title</MudText>
|
||||
<MudText Typo="Typo.h6" Style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">@PrivateEntity.GlobalEntity.Title</MudText>
|
||||
<MudMenu Icon="@Icons.Material.Filled.MoreVert" Color="Color.Default" Dense="true">
|
||||
<MudMenuItem>Edit</MudMenuItem>
|
||||
<MudMenuItem OnClick="@(() => OnRemove.InvokeAsync())">Remove</MudMenuItem>
|
||||
@@ -40,45 +40,50 @@
|
||||
</MudSelect>
|
||||
<!--</editor-fold>-->
|
||||
|
||||
<!--<editor-fold desc="Dropdown-Season">-->
|
||||
<MudSelect
|
||||
T="int?"
|
||||
Value="PrivateEntity.Season"
|
||||
ValueChanged="@(newSeason => OnSeasonChange.InvokeAsync(newSeason))"
|
||||
Dense="true"
|
||||
Variant="Variant.Outlined"
|
||||
Label="">
|
||||
@{
|
||||
int? currentSeason = PrivateEntity.Season ?? 1;
|
||||
int? startOffsetSeason = currentSeason > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int? i = startOffsetSeason; i <= 5; i++)
|
||||
{
|
||||
int? season = currentSeason + i;
|
||||
<MudSelectItem Value="@season">Staffel @season</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<!--</editor-fold>-->
|
||||
<!-- @if (PrivateEntity.GlobalEntity.MediaType.Name == "Series" || PrivateEntity.GlobalEntity.MediaType.Name == "Anime") -->
|
||||
<!--{-->
|
||||
<!--<editor-fold desc="Dropdown-Season">-->
|
||||
<MudSelect
|
||||
T="int?"
|
||||
Value="PrivateEntity.Season"
|
||||
ValueChanged="@(newSeason => OnSeasonChange.InvokeAsync(newSeason))"
|
||||
Dense="true"
|
||||
Variant="Variant.Outlined"
|
||||
Label=""
|
||||
Class="@(PrivateEntity.GlobalEntity.MediaType.Name == "Series" ? "" : "invisible")">
|
||||
@{
|
||||
int? currentSeason = PrivateEntity.Season ?? 1;
|
||||
int? startOffsetSeason = currentSeason > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int? i = startOffsetSeason; i <= 5; i++)
|
||||
{
|
||||
int? season = currentSeason + i;
|
||||
<MudSelectItem Value="@season">Staffel @season</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<!--</editor-fold>-->
|
||||
|
||||
<!--<editor-fold desc="Dropdown-Episode">-->
|
||||
<MudSelect
|
||||
T="int?"
|
||||
Value="PrivateEntity.Episode"
|
||||
ValueChanged="@(newEpisode => OnEpisodeChange.InvokeAsync(newEpisode))"
|
||||
Dense="true"
|
||||
Variant="Variant.Outlined"
|
||||
Label="">
|
||||
@{
|
||||
int? currentEpisode = PrivateEntity.Episode ?? 1;
|
||||
int? startOffsetEpisode = currentEpisode > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int? i = startOffsetEpisode; i <= 5; i++)
|
||||
{
|
||||
int? episode = currentEpisode + i;
|
||||
<MudSelectItem Value="@episode">Episode @episode</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<!--</editor-fold>-->
|
||||
<!--<editor-fold desc="Dropdown-Episode">-->
|
||||
<MudSelect
|
||||
T="int?"
|
||||
Value="PrivateEntity.Episode"
|
||||
ValueChanged="@(newEpisode => OnEpisodeChange.InvokeAsync(newEpisode))"
|
||||
Dense="true"
|
||||
Variant="Variant.Outlined"
|
||||
Label=""
|
||||
Class="@(PrivateEntity.GlobalEntity.MediaType.Name == "Series" ? "" : "invisible")">
|
||||
@{
|
||||
int? currentEpisode = PrivateEntity.Episode ?? 1;
|
||||
int? startOffsetEpisode = currentEpisode > 1 ? -1 : 0;
|
||||
}
|
||||
@for (int? i = startOffsetEpisode; i <= 5; i++)
|
||||
{
|
||||
int? episode = currentEpisode + i;
|
||||
<MudSelectItem Value="@episode">Episode @episode</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<!--</editor-fold>-->
|
||||
<!--}-->
|
||||
|
||||
<!--<editor-fold desc="Details Button">-->
|
||||
<MudStack Row="true" Justify="Justify.FlexEnd">
|
||||
|
||||
Reference in New Issue
Block a user