mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-12 18:29:18 +02:00
bump version
This commit is contained in:
parent
d3138aa97c
commit
f4947e2b4a
1 changed files with 118 additions and 118 deletions
|
@ -1,118 +1,118 @@
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
project-folder:
|
project-folder:
|
||||||
type: string
|
type: string
|
||||||
default: "SMBLibrary/"
|
default: "SMBLibrary/"
|
||||||
|
|
||||||
csproj-file:
|
csproj-file:
|
||||||
type: string
|
type: string
|
||||||
default: "SMBLibrary.csproj"
|
default: "SMBLibrary.csproj"
|
||||||
|
|
||||||
nuget-output-file:
|
nuget-output-file:
|
||||||
type: string
|
type: string
|
||||||
default: "bin/Release/Lansweeper.SMBLibrary.1.5.0.nupkg"
|
default: "bin/Release/Lansweeper.SMBLibrary.1.5.0.nupkg"
|
||||||
|
|
||||||
git-primary-branch:
|
git-primary-branch:
|
||||||
type: string
|
type: string
|
||||||
default: "master"
|
default: "master"
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
node:
|
node:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/node:12
|
- image: circleci/node:12
|
||||||
|
|
||||||
orbs:
|
orbs:
|
||||||
win: circleci/windows@2.2.0
|
win: circleci/windows@2.2.0
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
nuget-prepare:
|
nuget-prepare:
|
||||||
description: "generate nuget.config file to pull in (and publish) nuget dependencies "
|
description: "generate nuget.config file to pull in (and publish) nuget dependencies "
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Create local nuget config file
|
name: Create local nuget config file
|
||||||
command: |
|
command: |
|
||||||
$xml = "<?xml version='1.0' encoding='utf-8'?>
|
$xml = "<?xml version='1.0' encoding='utf-8'?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key='github' value='https://nuget.pkg.github.com/Lansweeper/index.json' />
|
<add key='github' value='https://nuget.pkg.github.com/Lansweeper/index.json' />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<packageSourceCredentials>
|
<packageSourceCredentials>
|
||||||
<github>
|
<github>
|
||||||
<add key='Username' value='LansweeperCloudDevelopment' />
|
<add key='Username' value='LansweeperCloudDevelopment' />
|
||||||
<add key='ClearTextPassword' value='$env:GITHUB_TOKEN' />
|
<add key='ClearTextPassword' value='$env:GITHUB_TOKEN' />
|
||||||
</github>
|
</github>
|
||||||
</packageSourceCredentials>
|
</packageSourceCredentials>
|
||||||
</configuration>"
|
</configuration>"
|
||||||
Out-File -FilePath nuget.config -InputObject $xml -Encoding ASCII
|
Out-File -FilePath nuget.config -InputObject $xml -Encoding ASCII
|
||||||
|
|
||||||
install-deps:
|
install-deps:
|
||||||
description: "Install and cache dependencies"
|
description: "Install and cache dependencies"
|
||||||
steps:
|
steps:
|
||||||
# Download and cache dependencies
|
# Download and cache dependencies
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- << pipeline.parameters.project-folder >>-dependencies-{{ checksum "yarn.lock" }}
|
- << pipeline.parameters.project-folder >>-dependencies-{{ checksum "yarn.lock" }}
|
||||||
- run: yarn install --pure-lockfile
|
- run: yarn install --pure-lockfile
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
key: << pipeline.parameters.project-folder >>-dependencies-{{ checksum "yarn.lock" }}
|
key: << pipeline.parameters.project-folder >>-dependencies-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
executor: win/default
|
executor: win/default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- nuget-prepare
|
- nuget-prepare
|
||||||
- run: dotnet build << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >> --configuration Release
|
- run: dotnet build << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >> --configuration Release
|
||||||
|
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: .
|
root: .
|
||||||
paths:
|
paths:
|
||||||
- .
|
- .
|
||||||
|
|
||||||
nuget-publish:
|
nuget-publish:
|
||||||
executor:
|
executor:
|
||||||
name: win/default
|
name: win/default
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: .
|
at: .
|
||||||
- run:
|
- run:
|
||||||
name: Set correct version in csproj file, build and pack it
|
name: Set correct version in csproj file, build and pack it
|
||||||
command: |
|
command: |
|
||||||
$env:package_version = "1.5.0"
|
$env:package_version = "1.6.0"
|
||||||
$file = Get-Item << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >>
|
$file = Get-Item << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >>
|
||||||
[xml]$cn = Get-Content $file
|
[xml]$cn = Get-Content $file
|
||||||
$cn.Project.PropertyGroup.Version="$env:package_version"
|
$cn.Project.PropertyGroup.Version="$env:package_version"
|
||||||
$cn.Save($file.FullName)
|
$cn.Save($file.FullName)
|
||||||
type ./<< pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >>
|
type ./<< pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >>
|
||||||
- run:
|
- run:
|
||||||
name: Pack the package
|
name: Pack the package
|
||||||
command: dotnet pack << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >> --configuration Release
|
command: dotnet pack << pipeline.parameters.project-folder >><< pipeline.parameters.csproj-file >> --configuration Release
|
||||||
- run:
|
- run:
|
||||||
name: Publish the package
|
name: Publish the package
|
||||||
command: |
|
command: |
|
||||||
dotnet nuget push << pipeline.parameters.project-folder >><< pipeline.parameters.nuget-output-file >> --source "github" --api-key $env:GITHUB_TOKEN
|
dotnet nuget push << pipeline.parameters.project-folder >><< pipeline.parameters.nuget-output-file >> --source "github" --api-key $env:GITHUB_TOKEN
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
ci_and_release_primary_branch:
|
ci_and_release_primary_branch:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- build:
|
||||||
context:
|
context:
|
||||||
- lec-github-packages-rw
|
- lec-github-packages-rw
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: << pipeline.parameters.git-primary-branch >>
|
only: << pipeline.parameters.git-primary-branch >>
|
||||||
|
|
||||||
- nuget-publish:
|
- nuget-publish:
|
||||||
requires:
|
requires:
|
||||||
- build
|
- build
|
||||||
context:
|
context:
|
||||||
- lec-github-packages-rw
|
- lec-github-packages-rw
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: << pipeline.parameters.git-primary-branch >>
|
only: << pipeline.parameters.git-primary-branch >>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue