55 lines
2.5 KiB
YAML
55 lines
2.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: litecharms-nuget-libraries
|
|
|
|
steps:
|
|
- name: build
|
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
|
commands:
|
|
- dotnet restore
|
|
- dotnet build -c Release --no-restore
|
|
|
|
- name: pack-and-publish
|
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
|
environment:
|
|
NEXUS_KEY: { from_secret: nexus_api_key }
|
|
NEXUS_URL: https://nexus.khongisa.co.za/repository/nuget-hosted/
|
|
VERSION: 1.${DRONE_BUILD_NUMBER}.0
|
|
commands:
|
|
- dotnet pack LiteCharms.Features/LiteCharms.Features.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
|
- dotnet nuget push dist/LiteCharms.Features.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
|
- dotnet pack LiteCharms.Features.TechShop/LiteCharms.Features.TechShop.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
|
- dotnet nuget push dist/LiteCharms.Features.TechShop.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
|
- dotnet pack LiteCharms.Features.MidrandBooks/LiteCharms.Features.MidrandBooks.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
|
- dotnet nuget push dist/LiteCharms.Features.MidrandBooks.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
|
|
|
- name: gitea-tag-release
|
|
image: alpine/git
|
|
environment:
|
|
GITEA_TOKEN: { from_secret: git_token }
|
|
GITEA_USER: { from_secret: git_username }
|
|
GITEA_PASS: { from_secret: git_password }
|
|
VERSION: 1.${DRONE_BUILD_NUMBER}.0
|
|
commands:
|
|
- echo "169.255.58.144 gitea.khongisa.co.za" >> /etc/hosts
|
|
- apk add --no-cache curl
|
|
- git remote set-url origin https://$${GITEA_USER}:$${GITEA_PASS}@gitea.khongisa.co.za/litecharms/components.git
|
|
- git tag $VERSION
|
|
- git push origin $VERSION
|
|
- |
|
|
curl -X POST "https://gitea.khongisa.co.za/api/v1/repos/litecharms/components/releases" \
|
|
-H "Authorization: token $${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"tag_name\": \"$VERSION\",
|
|
\"target_commitish\": \"${DRONE_COMMIT_SHA}\",
|
|
\"name\": \"Library Suite $VERSION\",
|
|
\"body\": \"### Published NuGet Packages\nAll packages versioned as **$VERSION**:\n* LiteCharms.Features\n* LiteCharms.Features.TechShop\n* LiteCharms.Features.MidrandBooks\n\n[View in Nexus](https://nexus.khongisa.co.za/repository/nuget-group/)\",
|
|
\"draft\": false,
|
|
\"prerelease\": false
|
|
}"
|
|
|
|
trigger:
|
|
event:
|
|
- pull_request |