feat: add configuration, CI workflow, and Dockerfile updates for Forgejo release sync
Run Forgejo Release Sync / sync (push) Failing after 40s
Run Forgejo Release Sync / sync (push) Failing after 40s
- Introduced `config.toml` to manage repository-specific settings. - Added GitHub Actions workflow for scheduled and manual Forgejo release synchronization. - Updated Dockerfile for Alpine AOT builds, customized Alpine mirrors, and improved dependency management.
This commit is contained in:
1 parent
8db845f27a
commit
d6fd01f642
5 files changed
+97
-15
No files matched your search
@@ -0,0 +1,54 @@
|
|||||||
|
name: Run Forgejo Release Sync
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # daily at 00:00 UTC
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: tsv-s1
|
||||||
|
container:
|
||||||
|
image: hub.hamdocker.ir/docker:dind
|
||||||
|
privileged: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Switch Alpine to MobinHost mirror
|
||||||
|
run: |
|
||||||
|
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d. -f1,2)
|
||||||
|
echo "https://mirror.mobinhost.com/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories
|
||||||
|
echo "https://mirror.mobinhost.com/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
|
||||||
|
|
||||||
|
- name: Install required tools
|
||||||
|
run: apk add --no-cache git
|
||||||
|
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
with:
|
||||||
|
buildkitd-config-inline: |
|
||||||
|
[registry."docker.io"]
|
||||||
|
mirrors = ["https://hub.hamdocker.ir"]
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: ForgejoReleaseSync
|
||||||
|
file: ForgejoReleaseSync/Dockerfile
|
||||||
|
push: false
|
||||||
|
load: true
|
||||||
|
tags: forgejo-release-sync:latest
|
||||||
|
|
||||||
|
- name: Run sync
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-e FORGEJO_INSTANCE="${{ secrets.FORGEJO_INSTANCE }}" \
|
||||||
|
-e FORGEJO_TOKEN="${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
-e SYNC_CONCURRENCY="${{ vars.SYNC_CONCURRENCY || '3' }}" \
|
||||||
|
-e REPO_CONFIG_FILE="/config/config.toml" \
|
||||||
|
-v "${{ github.workspace }}/config.toml:/config/config.toml:ro" \
|
||||||
|
forgejo-release-sync:latest
|
||||||
+1
-2
@@ -4,5 +4,4 @@ obj/
|
|||||||
riderModule.iml
|
riderModule.iml
|
||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
|
|
||||||
.env
|
.env
|
||||||
config.toml
|
|
||||||
+20
-13
@@ -1,21 +1,28 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base
|
FROM mcr.hamdocker.ir/dotnet/sdk:10.0.403-alpine3.24-aot AS build
|
||||||
USER $APP_UID
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["ForgejoReleaseSync.csproj", "./"]
|
COPY ["ForgejoReleaseSync.csproj", "./"]
|
||||||
|
|
||||||
|
RUN echo "https://mirror.mobinhost.com/alpine/v3.24/main" > /etc/apk/repositories && \
|
||||||
|
echo "https://mirror.mobinhost.com/alpine/v3.24/community" >> /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN apk add --no-cache clang zlib-dev
|
||||||
|
|
||||||
|
RUN dotnet nuget remove source nuget.org && \
|
||||||
|
dotnet nuget add source https://repo.hmirror.ir/nuget --name hmirror
|
||||||
|
|
||||||
RUN dotnet restore "ForgejoReleaseSync.csproj"
|
RUN dotnet restore "ForgejoReleaseSync.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/"
|
|
||||||
RUN dotnet build "./ForgejoReleaseSync.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
||||||
|
|
||||||
FROM build AS publish
|
RUN dotnet publish "ForgejoReleaseSync.csproj" \
|
||||||
ARG BUILD_CONFIGURATION=Release
|
-r linux-musl-x64 \
|
||||||
RUN dotnet publish "./ForgejoReleaseSync.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
-c $BUILD_CONFIGURATION \
|
||||||
|
-p:PublishAot=true \
|
||||||
|
-p:StripSymbols=true \
|
||||||
|
-p:InvariantGlobalization=true \
|
||||||
|
-o /app
|
||||||
|
|
||||||
FROM base AS final
|
FROM mcr.hamdocker.ir/dotnet/runtime-deps:10.0.14-alpine3.24
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=build /app .
|
||||||
ENTRYPOINT ["dotnet", "ForgejoReleaseSync.dll"]
|
ENTRYPOINT ["/app/ForgejoReleaseSync"]
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACallSiteFactory_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E2_003Fresharper_002Dhost_003FSourcesCache_003F51986e38149d7168a48244177b10e8ce2c0faf1d4b35fbbeaf26cb3d652320_003FCallSiteFactory_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpClient_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E2_003Fresharper_002Dhost_003FSourcesCache_003F4863135632cecd6c9a2afa21d4955a1586c4f677fbfbff7bc6b4b9a6d4d43_003FHttpClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpResponseMessage_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2026_002E2_003Fresharper_002Dhost_003FSourcesCache_003F6bf034d63496a626d546ae9288ec24565fca5bfa61c1964e18df9830f2fc8aee_003FHttpResponseMessage_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
[[chisel]]
|
||||||
|
GithubUrl = "https://github.com/jpillora/chisel"
|
||||||
|
ForgejoUrl = "https://gm.monasef.ir/jpillora/chisel"
|
||||||
|
IncludeAssetsRegex = '^chisel_.*_(?:linux_(?:amd64|arm(?:64|v[5-7])?)|windows_(?:amd64|arm64)|darwin_(?:amd64|arm64))(?:\.|$)'
|
||||||
|
ExcludeAssetsRegex = '^(?:^|_)(?:openbsd|386|mips[^_.]*|ppc64le?|s390x)(?:_|\.|$)'
|
||||||
|
|
||||||
|
#[[WhiteDNS-Wizard]]
|
||||||
|
#GithubUrl = "https://github.com/WhiteDNS/WhiteDNS-Wizard"
|
||||||
|
#ForgejoUrl = "https://gm.monasef.ir/WhiteDNS/WhiteDNS-Wizard"
|
||||||
|
#IncludeAssetsRegex = '^whitedns_.*_(?:linux-(?:amd64|arm(?:64|v[5-8])?)|macos-(?:amd64|arm64)|windows-(?:amd64|arm64))\.'
|
||||||
|
#ExcludeAssetsRegex = '(?:^|_)(?:freebsd|netbsd|openbsd|termux-android|[^_]+-(?:386|ppc\d*(?:le)?|riscv\d*|s390x|mips[^_.]*|loong64|wasm[^_.]*))(?=\.|_)'
|
||||||
|
|
||||||
|
#[[WhiteDNS-Android]]
|
||||||
|
#GithubUrl = "https://github.com/WhiteDNS/WhiteDNS-Android"
|
||||||
|
#ForgejoUrl = "https://gm.monasef.ir/WhiteDNS/WhiteDNS-Android"
|
||||||
|
#IncludeAssetsRegex = '^WhiteDNS-.*-(?:arm64-v8a|armeabi-v7a)\.apk$'
|
||||||
|
#ExcludeAssetsRegex = '-(?:x86(?:_64)?|universal)\.apk(?:\.idsig)?$'
|
||||||
|
|
||||||
Reference in new issue
Block a user