6 Commits

Author SHA1 Message Date
pooria.sh ecdea4d07c ci7
Release Docker Image / build-and-push (release) Failing after 9s
Release NuGet Packages / pack-and-push (release) Failing after 6m58s
2026-05-20 15:28:37 +03:30
pooria.sh 628f84c14b Update release-nuget.yml
Release Docker Image / build-and-push (release) Failing after 7s
Release NuGet Packages / pack-and-push (release) Failing after 1m52s
2026-05-20 15:21:53 +03:30
pooria.sh a52d2c9fe9 ci6
Release Docker Image / build-and-push (release) Failing after 29s
Release NuGet Packages / pack-and-push (release) Has been cancelled
2026-05-20 15:13:14 +03:30
pooria.sh 32bce2cdd2 ci5
Release NuGet Packages / pack-and-push (release) Successful in 2m54s
Release Docker Image / build-and-push (release) Failing after 1m18s
2026-05-20 14:41:47 +03:30
pooria.sh 490ed3815f ci4
Release NuGet Packages / pack-and-push (release) Failing after 3s
Release Docker Image / build-and-push (release) Has been cancelled
2026-05-20 14:35:27 +03:30
pooria.sh 97d20d3c8a ci2
Release Docker Image / build-and-push (release) Has been cancelled
Release NuGet Packages / pack-and-push (release) Has been cancelled
2026-05-20 14:27:46 +03:30
3 changed files with 47 additions and 6 deletions
+8 -1
View File
@@ -10,14 +10,20 @@ env:
IMAGE_NAME: sabp-apps/devops-test
RELEASE_TAG: ${{ gitea.event.release.tag_name }}
REF_NAME: ${{ gitea.ref_name }}
REPOSITORY: ${{ gitea.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
container:
image: mcr-mirror.liara.ir/dotnet/sdk:9.0
image: mcr-mirror.liara.ir/dotnet/sdk:10.0.202
steps:
- name: Checkout
shell: bash
run: |
git clone --depth 1 https://git.sabp.ir/sufi-chain/dev-ops-test.git .
- name: Build and push image
shell: bash
env:
@@ -35,6 +41,7 @@ jobs:
tag="${RELEASE_TAG:-$REF_NAME}"
tag="${tag#v}"
dotnet publish DevOpsTest.csproj \
-v:n \
--configuration Release \
--os linux \
--arch x64 \
+39 -5
View File
@@ -8,25 +8,55 @@ on:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_SOURCE_URL: https://nuget.sabp.ir/v3/index.json
NUGET_SOURCE_URL: ${{ secrets.NUGET_API_URL }}
PACKAGE_OUTPUT: ./artifacts/nuget
PACKAGE_PROJECTS: DevOpsPackageTest/DevOpsPackageTest.csproj
RELEASE_TAG: ${{ gitea.event.release.tag_name }}
REF_NAME: ${{ gitea.ref_name }}
REPOSITORY: ${{ gitea.repository }}
jobs:
pack-and-push:
runs-on: ubuntu-latest
container:
image: mcr-mirror.liara.ir/dotnet/sdk:9.0
image: mcr-mirror.liara.ir/dotnet/sdk:10.0.202
steps:
- name: Checkout
shell: bash
run: |
git clone --depth 1 https://git.sabp.ir/sufi-chain/dev-ops-test.git .
- name: Create NuGet.Config for HTTP BaGet
shell: bash
run: |
set -euo pipefail
if [ -z "${NUGET_SOURCE_URL:-}" ]; then
echo "NUGET_SOURCE_URL secret/env is required."
exit 1
fi
cat > NuGet.Config <<EOF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="baget" value="${NUGET_SOURCE_URL}" allowInsecureConnections="true" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
EOF
echo "NuGet.Config created:"
cat NuGet.Config
- name: Restore selected projects
shell: bash
run: |
set -euo pipefail
for project in $PACKAGE_PROJECTS; do
dotnet restore "$project"
dotnet restore "$project" --configfile NuGet.Config
done
- name: Build selected projects
@@ -61,6 +91,7 @@ jobs:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
set -euo pipefail
if [ -z "${NUGET_API_KEY:-}" ]; then
echo "NUGET_API_KEY secret is required."
exit 1
@@ -68,14 +99,17 @@ jobs:
shopt -s nullglob
packages=("$PACKAGE_OUTPUT"/*.nupkg)
if [ ${#packages[@]} -eq 0 ]; then
echo "No NuGet packages were produced."
exit 1
fi
for package in "${packages[@]}"; do
echo "Pushing $package ..."
dotnet nuget push "$package" \
--source "$NUGET_SOURCE_URL" \
--source baget \
--api-key "$NUGET_API_KEY" \
--skip-duplicate
--skip-duplicate \
--configfile NuGet.Config
done
Binary file not shown.