Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Parser
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anduin Xue
Parser
Commits
7a3ee042
There was an error fetching the commit references. Please try again later.
Commit
7a3ee042
authored
2 years ago
by
Anduin Xue
Browse files
Options
Downloads
Patches
Plain Diff
Add\Update .gitlab-ci.yml to match best practices and upload package to Nuget.
parent
7118c3a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+41
-10
41 additions, 10 deletions
.gitlab-ci.yml
with
41 additions
and
10 deletions
.gitlab-ci.yml
+
41
−
10
View file @
7a3ee042
stages
:
-
Building
-
Linting
-
Testing
-
Publishing
-
build
-
lint
-
test
-
publish
-
deploy
before_script
:
-
'
export
DOTNET_CLI_TELEMETRY_OPTOUT=1'
...
...
@@ -19,19 +20,19 @@ before_script:
-
'
dotnet
--info'
restore
:
stage
:
B
uild
ing
stage
:
b
uild
script
:
-
dotnet restore --configfile nuget.config
build
:
stage
:
B
uild
ing
stage
:
b
uild
needs
:
-
restore
script
:
-
dotnet build --no-self-contained
lint
:
stage
:
L
int
ing
stage
:
l
int
needs
:
-
build
script
:
...
...
@@ -44,7 +45,7 @@ lint:
-
./analyze_output.xml
test
:
stage
:
T
est
ing
stage
:
t
est
needs
:
-
build
coverage
:
'
/TOTAL_COVERAGE=(\d+.\d+)/'
...
...
@@ -68,7 +69,7 @@ test:
path
:
./Cobertura.xml
publish
:
stage
:
P
ublish
ing
stage
:
p
ublish
needs
:
-
lint
-
test
...
...
@@ -76,7 +77,7 @@ publish:
-
dotnet publish --configuration Release --runtime linux-x64 --no-self-contained *.sln
pack
:
stage
:
P
ublish
ing
stage
:
p
ublish
needs
:
-
lint
-
test
...
...
@@ -87,3 +88,33 @@ pack:
expire_in
:
1 week
paths
:
-
'
**/*.nupkg'
upload_to_nuget
:
stage
:
deploy
environment
:
production
needs
:
-
pack
dependencies
:
-
pack
script
:
-
|
for file in $(find . -name "*.nupkg"); do
dotnet nuget push "$file" --api-key "$NUGET_API_KEY" --source "https://api.nuget.org/v3/index.json" || exit 1;
done
only
:
-
master
upload_to_local_nuget
:
stage
:
deploy
environment
:
production
needs
:
-
pack
dependencies
:
-
pack
script
:
-
|
for file in $(find . -name "*.nupkg"); do
dotnet nuget push "$file" --api-key "$LOCAL_NUGET_API_KEY" --source "https://nuget.aiursoft.cn/v3/index.json" || exit 1;
done
only
:
-
master
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment