Compare commits
4 Commits
01b27b1b08
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 808ed11e53 | |||
| 98c57d5f30 | |||
| eba4315e92 | |||
| 815814e765 |
@@ -22,7 +22,10 @@ jobs:
|
||||
- name: Checkout
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git clone --depth 1 https://git.sabp.ir/sufi-chain/dev-ops-test.git .
|
||||
echo "=== Workspace contents ==="
|
||||
ls -la
|
||||
|
||||
- name: Build and push image
|
||||
shell: bash
|
||||
@@ -38,9 +41,16 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag="${RELEASE_TAG:-$REF_NAME}"
|
||||
if [ -n "${RELEASE_TAG:-}" ]; then
|
||||
tag="$RELEASE_TAG"
|
||||
else
|
||||
tag="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
|
||||
fi
|
||||
tag="${tag#v}"
|
||||
dotnet publish DevOpsTest.csproj \
|
||||
|
||||
echo "=== Building version: $tag ==="
|
||||
|
||||
dotnet publish "DevOpsTest/DevOpsTest/DevOpsTest.csproj" \
|
||||
-v:n \
|
||||
--configuration Release \
|
||||
--os linux \
|
||||
@@ -49,4 +59,4 @@ jobs:
|
||||
-p:ContainerRegistry="$REGISTRY" \
|
||||
-p:ContainerRepository="$IMAGE_NAME" \
|
||||
-p:ContainerBaseImage=mcr-mirror.liara.ir/dotnet/aspnet:10.0.202 \
|
||||
"-p:ContainerImageTags=$tag;latest"
|
||||
-p:ContainerImageTags="${tag};latest"
|
||||
|
||||
@@ -25,7 +25,10 @@ jobs:
|
||||
- name: Checkout
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git clone --depth 1 https://git.sabp.ir/sufi-chain/dev-ops-test.git .
|
||||
echo "=== Workspace contents ==="
|
||||
ls -la
|
||||
|
||||
- name: Restore selected projects
|
||||
shell: bash
|
||||
@@ -49,8 +52,13 @@ jobs:
|
||||
set -euo pipefail
|
||||
mkdir -p "$PACKAGE_OUTPUT"
|
||||
|
||||
version="${RELEASE_TAG:-$REF_NAME}"
|
||||
if [ -n "${RELEASE_TAG:-}" ]; then
|
||||
version="$RELEASE_TAG"
|
||||
else
|
||||
version="0.0.0-dev.$(date +%Y%m%d%H%M%S)"
|
||||
fi
|
||||
version="${version#v}"
|
||||
echo "=== Packing version: $version ==="
|
||||
|
||||
for project in $PACKAGE_PROJECTS; do
|
||||
dotnet pack "$project" \
|
||||
|
||||
@@ -101,7 +101,11 @@ jobs:
|
||||
- name: Checkout
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git clone --depth 1 https://git.sabp.ir/sufi-chain/dev-ops-test.git .
|
||||
pwd
|
||||
echo "=== Workspace contents ==="
|
||||
ls -la
|
||||
|
||||
- name: Build and push image
|
||||
shell: bash
|
||||
@@ -117,9 +121,17 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== Looking for project file ==="
|
||||
find . -name "DevOpsTest.csproj" -type f
|
||||
|
||||
if [ ! -f "DevOpsTest/DevOpsTest/DevOpsTest.csproj" ]; then
|
||||
echo "ERROR: DevOpsTest/DevOpsTest/DevOpsTest.csproj not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag="${RELEASE_TAG:-$REF_NAME}"
|
||||
tag="${tag#v}"
|
||||
dotnet publish DevOpsTest/DevOpsTest/DevOpsTest.csproj \
|
||||
dotnet publish "DevOpsTest/DevOpsTest/DevOpsTest.csproj" \
|
||||
-v:n \
|
||||
--configuration Release \
|
||||
--os linux \
|
||||
@@ -128,4 +140,4 @@ jobs:
|
||||
-p:ContainerRegistry="$REGISTRY" \
|
||||
-p:ContainerRepository="$IMAGE_NAME" \
|
||||
-p:ContainerBaseImage=mcr-mirror.liara.ir/dotnet/aspnet:10.0.202 \
|
||||
"-p:ContainerImageTags=$tag;latest"
|
||||
-p:ContainerImageTags="${tag};latest"
|
||||
|
||||
Reference in New Issue
Block a user