develop #1
1 changed files with 34 additions and 1 deletions
commit
daf3b5ad2c
|
|
@ -14,10 +14,15 @@ env:
|
|||
PROJECT_PATH: imagecatalog/ImageCatalog 2.csproj
|
||||
PUBLISH_DIR: artifacts/publish/win-x64
|
||||
ARTIFACT_NAME: imagecatalog-windows-avalonia
|
||||
NUGET_SOURCE_NAME: Nuget-GitLab-AIFotoONLUS
|
||||
NUGET_SOURCE_URL: https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
env:
|
||||
NUGET_USERNAME: ${{ secrets.NUGET_USERNAME }}
|
||||
NUGET_PASSWORD: ${{ secrets.NUGET_PASSWORD }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -28,8 +33,35 @@ jobs:
|
|||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Validate NuGet secrets
|
||||
run: |
|
||||
set -eu
|
||||
if [ -z "${NUGET_USERNAME}" ]; then
|
||||
echo "secrets.NUGET_USERNAME is required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${NUGET_PASSWORD}" ]; then
|
||||
echo "secrets.NUGET_PASSWORD is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Configure private NuGet source
|
||||
run: |
|
||||
set -eu
|
||||
temp_config="${RUNNER_TEMP}/nuget.config"
|
||||
cp NuGet.Config "${temp_config}"
|
||||
|
||||
dotnet nuget update source "${{ env.NUGET_SOURCE_NAME }}" \
|
||||
--source "${{ env.NUGET_SOURCE_URL }}" \
|
||||
--username "${NUGET_USERNAME}" \
|
||||
--password "${NUGET_PASSWORD}" \
|
||||
--store-password-in-clear-text \
|
||||
--configfile "${temp_config}"
|
||||
|
||||
echo "NUGET_CONFIG_PATH=${temp_config}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore "${{ env.PROJECT_PATH }}" -r win-x64
|
||||
run: dotnet restore "${{ env.PROJECT_PATH }}" -r win-x64 --configfile "${NUGET_CONFIG_PATH}"
|
||||
|
||||
- name: Publish Windows Avalonia build
|
||||
run: |
|
||||
|
|
@ -38,6 +70,7 @@ jobs:
|
|||
-c Release \
|
||||
-r win-x64 \
|
||||
--self-contained true \
|
||||
--no-restore \
|
||||
-p:AvaloniaWindowsCrossPublish=true \
|
||||
-p:PublishSingleFile=true \
|
||||
-p:PublishTrimmed=false \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue