Migrated CI from gitlab to gitea
This commit is contained in:
60
.gitea/workflows/branch-build.yml
Normal file
60
.gitea/workflows/branch-build.yml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Branch Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
TZ: 'Europe/Berlin'
|
||||||
|
LANG: 'de'
|
||||||
|
CONFIGURATION: 'Debug'
|
||||||
|
CI_SERVER_HOST: ${{ gitea.server_url }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-test-deploy:
|
||||||
|
runs-on: ubuntu
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v5
|
||||||
|
with:
|
||||||
|
dotnet-version: 8.x
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet restore -v q
|
||||||
|
dotnet tool restore -v q
|
||||||
|
|
||||||
|
- name: Setup tools
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
|
||||||
|
|
||||||
|
- name: Build solution
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
shopt -s globstar
|
||||||
|
mkdir /artifacts
|
||||||
|
dotnet build -c ${CONFIGURATION} --no-restore --nologo
|
||||||
|
mv ./**/*.nupkg /artifacts/ || true
|
||||||
|
mv ./**/*.snupkg /artifacts/ || true
|
||||||
|
|
||||||
|
- name: Test solution
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura
|
||||||
|
/dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary"
|
||||||
|
cat /reports/Summary.txt
|
||||||
|
|
||||||
|
- name: Publish packages
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet nuget push -k "${{ secrets.BAGET_APIKEY }}" -s https://nuget.am-wd.de/v3/index.json --skip-duplicate /artifacts/*.nupkg
|
||||||
78
.gitea/workflows/release-build.yml
Normal file
78
.gitea/workflows/release-build.yml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
name: Release Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
TZ: 'Europe/Berlin'
|
||||||
|
LANG: 'de'
|
||||||
|
CONFIGURATION: 'Release'
|
||||||
|
CI_SERVER_HOST: ${{ gitea.server_url }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-test-deploy:
|
||||||
|
runs-on: ubuntu
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v5
|
||||||
|
with:
|
||||||
|
dotnet-version: 8.x
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet restore -v q
|
||||||
|
dotnet tool restore -v q
|
||||||
|
|
||||||
|
- name: Setup tools
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
|
||||||
|
dotnet tool install docfx --tool-path /dotnet-tools
|
||||||
|
|
||||||
|
- name: Build solution
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
shopt -s globstar
|
||||||
|
mkdir /artifacts
|
||||||
|
dotnet build -c ${CONFIGURATION} --no-restore --nologo
|
||||||
|
mv ./**/*.nupkg /artifacts/ || true
|
||||||
|
mv ./**/*.snupkg /artifacts/ || true
|
||||||
|
|
||||||
|
- name: Test solution
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet test -c ${CONFIGURATION} --no-build --nologo /p:CoverletOutputFormat=Cobertura
|
||||||
|
/dotnet-tools/reportgenerator "-reports:${{ gitea.workspace }}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary"
|
||||||
|
|
||||||
|
- name: Publish packages
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
dotnet nuget push -k "${{ secrets.NUGET_APIKEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate /artifacts/*.nupkg
|
||||||
|
|
||||||
|
- name: Publish documentation
|
||||||
|
env:
|
||||||
|
DOCFX_SOURCE_REPOSITORY_URL: 'https://github.com/AM-WD/AMWD.Protocols.Modbus'
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
/dotnet-tools/docfx metadata docs/docfx.json
|
||||||
|
/dotnet-tools/docfx build docs/docfx.json
|
||||||
|
tar -C "${{ gitea.workspace }}/docs/_site" -czf "/artifacts/docs.tar.gz" .
|
||||||
|
curl -sSL --no-progress-meter --user "${{ secrets.DOCS_DEPLOY_USER }}:${{ secrets.DOCS_DEPLOY_PASS }}" -F docs=modbus -F dump=@/artifacts/docs.tar.gz "${{ vars.DOCS_DEPLOY_URL }}"
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifacts
|
||||||
|
path: |
|
||||||
|
/artifacts/*
|
||||||
|
/reports/Summary.txt
|
||||||
157
.gitlab-ci.yml
157
.gitlab-ci.yml
@@ -1,157 +0,0 @@
|
|||||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
||||||
|
|
||||||
variables:
|
|
||||||
TZ: "Europe/Berlin"
|
|
||||||
LANG: "de"
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
build-debug:
|
|
||||||
stage: build
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- 64bit
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG == null
|
|
||||||
script:
|
|
||||||
- shopt -s globstar
|
|
||||||
- mkdir ./artifacts
|
|
||||||
- dotnet build -c Debug --nologo
|
|
||||||
- mv ./**/*.nupkg ./artifacts/
|
|
||||||
- mv ./**/*.snupkg ./artifacts/
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- artifacts/*.nupkg
|
|
||||||
- artifacts/*.snupkg
|
|
||||||
expire_in: 1 days
|
|
||||||
|
|
||||||
test-debug:
|
|
||||||
stage: test
|
|
||||||
dependencies:
|
|
||||||
- build-debug
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- 64bit
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG == null
|
|
||||||
coverage: /Branch coverage[\s\S].+%/
|
|
||||||
before_script:
|
|
||||||
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
|
|
||||||
script:
|
|
||||||
- dotnet test -c Debug --nologo /p:CoverletOutputFormat=Cobertura
|
|
||||||
- /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" -reportType:TextSummary
|
|
||||||
after_script:
|
|
||||||
- cat /reports/Summary.txt
|
|
||||||
artifacts:
|
|
||||||
when: always
|
|
||||||
reports:
|
|
||||||
coverage_report:
|
|
||||||
coverage_format: cobertura
|
|
||||||
path: ./**/coverage.cobertura.xml
|
|
||||||
|
|
||||||
deploy-debug:
|
|
||||||
stage: deploy
|
|
||||||
dependencies:
|
|
||||||
- build-debug
|
|
||||||
- test-debug
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- server
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG == null
|
|
||||||
script:
|
|
||||||
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/*.nupkg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
build-release:
|
|
||||||
stage: build
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- amd64
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG != null
|
|
||||||
script:
|
|
||||||
- shopt -s globstar
|
|
||||||
- mkdir ./artifacts
|
|
||||||
- dotnet build -c Release --nologo
|
|
||||||
- mv ./**/*.nupkg ./artifacts/
|
|
||||||
- mv ./**/*.snupkg ./artifacts/
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- artifacts/*.nupkg
|
|
||||||
- artifacts/*.snupkg
|
|
||||||
expire_in: 7 days
|
|
||||||
|
|
||||||
test-release:
|
|
||||||
stage: test
|
|
||||||
dependencies:
|
|
||||||
- build-release
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- amd64
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG != null
|
|
||||||
before_script:
|
|
||||||
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
|
|
||||||
script:
|
|
||||||
- dotnet test -c Release --nologo /p:CoverletOutputFormat=Cobertura
|
|
||||||
- /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" -reportType:TextSummary
|
|
||||||
after_script:
|
|
||||||
- cat /reports/Summary.txt
|
|
||||||
artifacts:
|
|
||||||
when: always
|
|
||||||
reports:
|
|
||||||
coverage_report:
|
|
||||||
coverage_format: cobertura
|
|
||||||
path: ./**/coverage.cobertura.xml
|
|
||||||
|
|
||||||
deploy-release:
|
|
||||||
stage: deploy
|
|
||||||
dependencies:
|
|
||||||
- build-release
|
|
||||||
- test-release
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- server
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG != null
|
|
||||||
script:
|
|
||||||
- dotnet nuget push -k $NUGET_APIKEY -s https://api.nuget.org/v3/index.json --skip-duplicate artifacts/*.nupkg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
publish-docs:
|
|
||||||
variables:
|
|
||||||
DOCFX_SOURCE_REPOSITORY_URL: "https://github.com/AM-WD/AMWD.Protocols.Modbus"
|
|
||||||
stage: deploy
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- lnx
|
|
||||||
- server
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG != null
|
|
||||||
before_script:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get -y install zip unzip
|
|
||||||
- dotnet tool install docfx --tool-path /dotnet-tools
|
|
||||||
script:
|
|
||||||
# Build the docs
|
|
||||||
- dotnet build -c Release --nologo
|
|
||||||
- /dotnet-tools/docfx metadata docs/docfx.json
|
|
||||||
- /dotnet-tools/docfx build docs/docfx.json
|
|
||||||
# Deploy the docs
|
|
||||||
- cd docs/_site
|
|
||||||
- zip -r ../docs.zip *
|
|
||||||
- curl --user "$DOCS_DEPLOY_USER:$DOCS_DEPLOY_PASS" -F docs=modbus -F dump=@../docs.zip "$DOCS_DEPLOY_URL"
|
|
||||||
@@ -25,7 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{2ED08B
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{C8065AE3-BA87-49AC-8100-C85D6DF7E436}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{C8065AE3-BA87-49AC-8100-C85D6DF7E436}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitlab-ci.yml = .gitlab-ci.yml
|
|
||||||
Directory.Build.props = Directory.Build.props
|
Directory.Build.props = Directory.Build.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
@@ -54,6 +53,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool", "tool", "{3429CE19-2
|
|||||||
tool\Directory.Build.props = tool\Directory.Build.props
|
tool\Directory.Build.props = tool\Directory.Build.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{42806262-7371-4239-AC04-33DC8E2596F1}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.gitea\workflows\branch-build.yml = .gitea\workflows\branch-build.yml
|
||||||
|
.gitea\workflows\release-build.yml = .gitea\workflows\release-build.yml
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -98,6 +103,7 @@ Global
|
|||||||
{D966826F-EE6C-4BC0-9185-C2A9A50FD586} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
{D966826F-EE6C-4BC0-9185-C2A9A50FD586} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||||
{B0E53462-B0ED-4685-8AA5-948DC160EE27} = {3429CE19-211E-4AFA-9629-D7E1A360B7AC}
|
{B0E53462-B0ED-4685-8AA5-948DC160EE27} = {3429CE19-211E-4AFA-9629-D7E1A360B7AC}
|
||||||
{AC922E80-E9B6-493D-B1D1-752527E883ED} = {3429CE19-211E-4AFA-9629-D7E1A360B7AC}
|
{AC922E80-E9B6-493D-B1D1-752527E883ED} = {3429CE19-211E-4AFA-9629-D7E1A360B7AC}
|
||||||
|
{42806262-7371-4239-AC04-33DC8E2596F1} = {C8065AE3-BA87-49AC-8100-C85D6DF7E436}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {E4FD8EF0-3594-4994-BE80-5FADA5EE17B4}
|
SolutionGuid = {E4FD8EF0-3594-4994-BE80-5FADA5EE17B4}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Reorganized folder structure to allow documentation generation.
|
- Reorganized folder structure to allow documentation generation.
|
||||||
|
- Migrated main repository from GitLab to Gitea.
|
||||||
|
|
||||||
|
|
||||||
## [v0.4.2] (2025-02-07)
|
## [v0.4.2] (2025-02-07)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AMWD.NetRevisionTask" Version="1.3.0">
|
<PackageReference Include="AMWD.NetRevisionTask" Version="1.4.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
Here you can find a basic implementation of the Modbus protocol.
|
Here you can find a basic implementation of the Modbus protocol.
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -37,8 +36,7 @@ It uses a specific TCP connection implementation and plugs all things from the C
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Published under [MIT License] (see [choose a license])
|
Published under [MIT License] (see [choose a license])
|
||||||
[](https://link.am-wd.de/donate)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
||||||
|
<NrtContinuousIntegrationBuild>$(ContinuousIntegrationBuild)</NrtContinuousIntegrationBuild>
|
||||||
|
|
||||||
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
||||||
<CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
|
<CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
|
||||||
@@ -13,7 +14,6 @@
|
|||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<IncludeSymbols>true</IncludeSymbols>
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
<EmbedUntrackedSources>false</EmbedUntrackedSources>
|
|
||||||
|
|
||||||
<PackageIcon>package-icon.png</PackageIcon>
|
<PackageIcon>package-icon.png</PackageIcon>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
@@ -23,13 +23,14 @@
|
|||||||
<AssemblyOriginatorKeyFile>../../AMWD.Protocols.Modbus.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>../../AMWD.Protocols.Modbus.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(GITLAB_CI)' == 'true'">
|
<PropertyGroup Condition="'$(CI)' == 'true'">
|
||||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(GITLAB_CI)' == 'true'">
|
<ItemGroup Condition="'$(CI)' == 'true'">
|
||||||
<SourceLinkGitLabHost Include="$(CI_SERVER_HOST)" Version="$(CI_SERVER_VERSION)" />
|
<SourceLinkGiteaHost Include="$(CI_SERVER_HOST)" />
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="8.0.0">
|
<PackageReference Include="Microsoft.SourceLink.Gitea" Version="8.0.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
Reference in New Issue
Block a user