Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FIT-Connect-SDK - .NET
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
FIT-Connect
FIT-Connect-SDK - .NET
Commits
f9ab5a28
Commit
f9ab5a28
authored
2 years ago
by
Klaus Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Shell script running, CI not tested
parent
ee5d896b
No related branches found
No related tags found
1 merge request
!29
830 Version Header
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+15
-0
15 additions, 0 deletions
.gitlab-ci.yml
FitConnect/ProjectSpecification.cs
+1
-1
1 addition, 1 deletion
FitConnect/ProjectSpecification.cs
nuget_upload.sh
+7
-10
7 additions, 10 deletions
nuget_upload.sh
with
23 additions
and
11 deletions
.gitlab-ci.yml
+
15
−
0
View file @
f9ab5a28
...
@@ -7,6 +7,7 @@ stages:
...
@@ -7,6 +7,7 @@ stages:
-
lint
-
lint
-
test
-
test
-
build
-
build
-
nugetPack
reuse
:
reuse
:
extends
:
.reuse
extends
:
.reuse
...
@@ -17,6 +18,20 @@ build:
...
@@ -17,6 +18,20 @@ build:
stage
:
build
stage
:
build
image
:
mcr.microsoft.com/dotnet/sdk:6.0
image
:
mcr.microsoft.com/dotnet/sdk:6.0
script
:
dotnet build FitConnect
script
:
dotnet build FitConnect
nugetPack
:
only
:
-
tags
-
main
stage
:
nugetPack
- image
:
mcr.microsoft.com/dotnet/sdk:6.0
script
:
-
sed -i "" -e "s|<PackageVersion>.*</PackageVersion>|<PackageVersion>$CI_COMMIT_TAG</PackageVersion>|" FitConnect/FitConnect.csproj
-
FILE_VERSION=$("$1" | sed -r 's|^(([0-9]+).([0-9]+).([0-9]+))(.*)$|\1|')
-
sed -i "" -e "s|<AssemblyVersion>.*</AssemblyVersion>|<AssemblyVersion>$FILE_VERSION</AssemblyVersion>|" FitConnect/FitConnect.csproj
-
sed -i "" -e "s|<FileVersion>.*</FileVersion>|<FileVersion>$FILE_VERSION</FileVersion>|" FitConnect/FitConnect.csproj
-
dotnet pack FitConnect -c Release -o ./artifacts
# - dotnet nuget push ./artifacts/*.nupkg --api-key $NUGET_API_KEY --source $NUGET_SOURCE
test
:
test
:
stage
:
test
stage
:
test
...
...
This diff is collapsed.
Click to expand it.
FitConnect/ProjectSpecification.cs
+
1
−
1
View file @
f9ab5a28
...
@@ -13,7 +13,7 @@ internal static class ProjectSpecification {
...
@@ -13,7 +13,7 @@ internal static class ProjectSpecification {
public
const
string
CallbackTimestamp
=
"callback-timestamp"
;
public
const
string
CallbackTimestamp
=
"callback-timestamp"
;
public
const
string
CallbackAuthentication
=
"callback-authentication"
;
public
const
string
CallbackAuthentication
=
"callback-authentication"
;
public
const
string
PackageVersion
=
"0.9.3-beta.2"
;
public
const
string
PackageVersion
=
"0.9.3-beta.2"
;
public
const
string
CommitId
=
"
7338f1
6"
;
public
const
string
CommitId
=
"
ee5d89
6"
;
public
static
byte
[]
CalculateCallbackHmac
(
string
callbackSecret
,
long
timestamp
,
string
body
)
{
public
static
byte
[]
CalculateCallbackHmac
(
string
callbackSecret
,
long
timestamp
,
string
body
)
{
...
...
This diff is collapsed.
Click to expand it.
nuget_upload.sh
+
7
−
10
View file @
f9ab5a28
#!/bin/zsh
#!/bin/zsh
#
CURRENT=$(git branch | grep \* | cut -d ' ' -f2)
CURRENT
=
$(
git branch |
grep
\*
|
cut
-d
' '
-f2
)
#
if [ "$CURRENT" != "main" ]; then
if
[
"
$CURRENT
"
!=
"main"
]
;
then
#
echo "Not on main branch"
echo
"Not on main branch"
#
exit 1
exit
1
#
fi
fi
### Running build script
### Running build script
if
[
-z
"
$1
"
]
;
then
if
[
-z
"
$1
"
]
;
then
...
@@ -19,12 +19,10 @@ sed -i "" -e "s|<FileVersion>.*</FileVersion>|<FileVersion>$FILE_VERSION</FileVe
...
@@ -19,12 +19,10 @@ sed -i "" -e "s|<FileVersion>.*</FileVersion>|<FileVersion>$FILE_VERSION</FileVe
sed
-i
""
-e
"s|<PackageVersion>.*</PackageVersion>|<PackageVersion>
$1
</PackageVersion>|"
FitConnect/FitConnect.csproj
sed
-i
""
-e
"s|<PackageVersion>.*</PackageVersion>|<PackageVersion>
$1
</PackageVersion>|"
FitConnect/FitConnect.csproj
sed
-i
""
-e
"s|public const string PackageVersion =
\"
.*
\"
;|public const string PackageVersion =
\"
$1
\"
;|"
FitConnect/ProjectSpecification.cs
sed
-i
""
-e
"s|public const string PackageVersion =
\"
.*
\"
;|public const string PackageVersion =
\"
$1
\"
;|"
FitConnect/ProjectSpecification.cs
git add
.
&&
git commit
-m
"Version
$1
"
COMMIT_ID
=
$(
git rev-parse
--short
HEAD
)
COMMIT_ID
=
$(
git rev-parse
--short
HEAD
)
sed
-i
""
-e
"s|public const string CommitId.*|public const string CommitId =
\"
$COMMIT_ID
\"
;|"
FitConnect/ProjectSpecification.cs
sed
-i
""
-e
"s|public const string CommitId.*|public const string CommitId =
\"
$COMMIT_ID
\"
;|"
FitConnect/ProjectSpecification.cs
git add
.
git commit
--amend
--no-edit
dotnet clean
dotnet clean
...
@@ -40,8 +38,7 @@ fi
...
@@ -40,8 +38,7 @@ fi
cp
"FitConnect/bin/Release/FitConnect.
$1
.nupkg"
.
cp
"FitConnect/bin/Release/FitConnect.
$1
.nupkg"
.
exit
200
git tag
-a
"
$1
"
-m
"Version
$1
"
&&
git push
&&
git push
--tags
git add
.
&&
git commit
-m
"Version
$1
"
&&
git tag
-a
"
$1
"
-m
"Version
$1
"
&&
git push
&&
git push
--tags
dotnet nuget push
"FitConnect.
$1
.nupkg"
-k
$(
cat
nuget_api.txt
)
-s
https://api.nuget.org/v3/index.json
dotnet nuget push
"FitConnect.
$1
.nupkg"
-k
$(
cat
nuget_api.txt
)
-s
https://api.nuget.org/v3/index.json
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