mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2024-10-02 20:13:13 +00:00
WIP: Updated .gitlab-ci and exe_builder.iss to work with CI, allowing for automatic windows releases, testing
This commit is contained in:
parent
49a923ba95
commit
ea254c2b6f
2 changed files with 46 additions and 6 deletions
|
@ -3,8 +3,9 @@ image: mcr.microsoft.com/dotnet/sdk:5.0
|
|||
stages:
|
||||
- build
|
||||
- test
|
||||
- upload
|
||||
- release
|
||||
- upload-builds
|
||||
# - release
|
||||
- upload-windows-updater-release
|
||||
|
||||
variables:
|
||||
project: "NadekoBot"
|
||||
|
@ -14,6 +15,8 @@ variables:
|
|||
WIN_X64_OUTPUT_DIR: "nadekobot-windows-x64"
|
||||
WIN_X64_RELEASE: "$CI_COMMIT_TAG-windows-x64-build.zip"
|
||||
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/NadekoBot-build/${CI_COMMIT_TAG}"
|
||||
INSTALLER_OUTPUT_DIR: "~/Documents/nadeko-installers"
|
||||
INSTALLER_FILE_NAME: "nadeko-setup-${CI_COMMIT_TAG}.exe"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -25,8 +28,8 @@ build:
|
|||
- "$LINUX_X64_OUTPUT_DIR/"
|
||||
- "$WIN_X64_OUTPUT_DIR/"
|
||||
|
||||
upload:
|
||||
stage: upload
|
||||
upload-builds:
|
||||
stage: upload-builds
|
||||
image: alpine:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
@ -38,6 +41,7 @@ upload:
|
|||
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
|
||||
|
@ -55,4 +59,40 @@ test:
|
|||
tests_path: "src/$tests"
|
||||
script:
|
||||
- "cd $tests_path"
|
||||
- "dotnet test"
|
||||
- "dotnet test"
|
||||
|
||||
publish-windows:
|
||||
stage: publish-windows
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
image: scottyhardy/docker-wine
|
||||
before_script:
|
||||
- choco install dotnet-5.0-runtime -y
|
||||
- choco install dotnet-5.0-sdk -y
|
||||
- choco install innosetup -y
|
||||
artifacts:
|
||||
paths:
|
||||
- "$INSTALLER_OUTPUT_DIR/$INSTALLER_FILE_NAME"
|
||||
- "$INSTALLER_OUTPUT_DIR/releases.json"
|
||||
script:
|
||||
- dotnet clean
|
||||
- dotnet restore
|
||||
- dotnet publish -c Release --runtime win7-x64 /p:Version=$CI_COMMIT_TAG src/NadekoBot
|
||||
- $env:NADEKOBOT_INSTALL_VERSION = $CI_COMMIT_TAG
|
||||
- iscc.exe "/O+" ".\exe_builder.iss"
|
||||
- echo "{ \"VersionName\":\"$CI_COMMIT_TAG\",\"DownloadLink\":\"https:\/\/cdn.nadeko.bot\/dl\/bot\/v3\/$INSTALLER_FILE_NAME\", }" > releases.json
|
||||
tags:
|
||||
- windows
|
||||
|
||||
upload-windows-updater-release:
|
||||
stage: upload-windows-updater-release
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
image:
|
||||
name: amazon/aws-cli
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- export NADEKOBOT_INSTALL_VERSION=$CI_COMMIT_TAG
|
||||
- aws --version
|
||||
- aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "test-dl/releases.json" --acl public-read --body "$INSTALLER_OUTPUT_DIR/releases.json"
|
||||
- aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "test-dl/$INSTALLER_FILE_NAME" --acl public-read --body "$INSTALLER_OUTPUT_DIR/$INSTALLER_FILE_NAME"
|
|
@ -15,7 +15,7 @@ SolidCompression=yes
|
|||
UsePreviousLanguage=no
|
||||
UsePreviousSetupType=no
|
||||
UsePreviousAppDir=no
|
||||
OutputDir=userdocs:_projekti/nadeko-installers/{#version}/
|
||||
OutputDir=userdocs:nadeko-installers/{#version}/
|
||||
OutputBaseFilename=nadeko-setup-{#version}
|
||||
AppReadmeFile=https://nadeko.bot/commands
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
|
|
Loading…
Reference in a new issue