mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Fixes for .gitlab-ci.yml
This commit is contained in:
@@ -1,33 +1,53 @@
|
|||||||
image: mcr.microsoft.com/dotnet/sdk:5.0
|
image: mcr.microsoft.com/dotnet/sdk:5.0
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- publish
|
- publish
|
||||||
|
- test
|
||||||
|
- upload
|
||||||
|
- release
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
project: "NadekoBot"
|
project: "NadekoBot"
|
||||||
tests: "NadekoBot.Tests"
|
tests: "NadekoBot.Tests"
|
||||||
|
LINUX_X64_OUTPUT_DIR: "output-linux-x64"
|
||||||
before_script:
|
LINUX_X64_RELEASE: "$CI_COMMIT_TAG-linux-x64-build.tar"
|
||||||
- "dotnet restore"
|
WIN_X64_OUTPUT_DIR: "output-windows-x64"
|
||||||
|
WIN_X64_RELEASE: "$CI_COMMIT_TAG-windows-x64-build.zip"
|
||||||
build:
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/NadekoBot-build/${CI_COMMIT_TAG}"
|
||||||
stage: build
|
|
||||||
variables:
|
|
||||||
build_path: "src/$project"
|
|
||||||
script:
|
|
||||||
- "cd $build_path"
|
|
||||||
- "dotnet build -c Release"
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
stage: publish
|
stage: publish
|
||||||
variables:
|
|
||||||
build_path: "src"
|
|
||||||
script:
|
script:
|
||||||
- "cd $build_path"
|
- "dotnet publish -c Release -r linux-x64 -o $LINUX_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
|
||||||
- "dotnet publish -c Release -r win7-x64 -o output-windows-x64 src/NadekoBot/NadekoBot.csproj"
|
- "dotnet publish -c Release -r win7-x64 -o $WIN_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj"
|
||||||
- "dotnet publish -c Release -r linux-x64 -o output-linux-x64 src/NadekoBot/NadekoBot.csproj"
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "$LINUX_X64_OUTPUT_DIR/"
|
||||||
|
- "$WIN_X64_OUTPUT_DIR/"
|
||||||
|
|
||||||
|
upload:
|
||||||
|
stage: upload
|
||||||
|
image: alpine:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- apk add --no-cache curl tar zip
|
||||||
|
- "tar cvf $LINUX_X64_RELEASE $LINUX_X64_OUTPUT_DIR/*"
|
||||||
|
- "zip -r $WIN_X64_RELEASE $WIN_X64_OUTPUT_DIR/*"
|
||||||
|
- |
|
||||||
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file $LINUX_X64_RELEASE $PACKAGE_REGISTRY_URL/$LINUX_X64_RELEASE
|
||||||
|
- |
|
||||||
|
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file $WIN_X64_RELEASE $PACKAGE_REGISTRY_URL/$WIN_X64_RELEASE
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
|
||||||
|
--assets-link "{\"name\":\"${LINUX_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_X64_RELEASE}\"}" \
|
||||||
|
--assets-link "{\"name\":\"${WIN_X64_RELEASE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${WIN_X64_RELEASE}\"}"
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
Reference in New Issue
Block a user