Skip to content

Commit 09620f4

Browse files
committed
Push a ci package to ci feed
1 parent b2197f9 commit 09620f4

File tree

2 files changed

+67
-52
lines changed

2 files changed

+67
-52
lines changed

.github/workflows/build-and-test.yml

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: CI
44
on:
55
push:
66
branches:
7-
- dev
7+
- feature/moryx-file-system-ci-publish
88
- future
99
tags:
1010
- v[0-9]+.[0-9]+.[0-9]+ # Matches all semantic versioning tags with major, minor, patch
@@ -40,59 +40,74 @@ jobs:
4040

4141
Build:
4242
needs: [EnvVar]
43-
uses: phoenixcontact/tools/.github/workflows/build-tool.yml@main
44-
with:
45-
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
46-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
47+
- name: Setup Node version
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 16
4751

48-
UnitTests:
49-
needs: [EnvVar, Build]
50-
uses: phoenixcontact/tools/.github/workflows/unittest-tool.yml@main
51-
with:
52-
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
53-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
52+
- name: Setup .NET SDK
53+
uses: actions/setup-dotnet@v3
54+
with:
55+
dotnet-version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
56+
57+
- name: Clean
58+
run: dotnet clean && dotnet nuget locals all --clear
5459

55-
IntegrationTests:
60+
- name: Execute dotnet restore
61+
run: dotnet restore
62+
63+
- name: Execute dotnet build
64+
run: |
65+
ASSEMBLY_VERSION="$(cat VERSION)"
66+
ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0
67+
echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}"
68+
FILE_VERSION="$(cat VERSION)"."${{github.run_number}}"
69+
echo "FILE_VERSION = ${FILE_VERSION}"
70+
INFORMATIONAL_VERSION="$(cat VERSION)"-"moryx-file-system-ci-publish"."${{github.run_number}}"
71+
echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}"
72+
dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION
73+
74+
- name: Execute dotnet pack with production version (dev or future)
75+
run: |
76+
PRODUCTION_VERSION="$(cat VERSION)"-"moryx-file-system-ci-publish"."${{github.run_number}}"
77+
echo "PRODUCTION_VERSION = ${PRODUCTION_VERSION}"
78+
dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$PRODUCTION_VERSION
79+
80+
- name: Upload package artifacts
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: ${{ needs.EnvVar.outputs.REPOSITORY_NAME}}-packages
84+
path: artifacts/packages/
85+
retention-days: 1
86+
87+
Publish-CI:
5688
needs: [EnvVar, Build]
57-
uses: phoenixcontact/tools/.github/workflows/integrationtest-tool.yml@main
58-
with:
59-
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
60-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v2
6192

62-
ReportGenerator:
63-
needs: [EnvVar, UnitTests, IntegrationTests]
64-
uses: phoenixcontact/tools/.github/workflows/reportgenerator-tool.yml@main
65-
with:
66-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
67-
68-
Publish-Test-Coverage:
69-
needs: [EnvVar, ReportGenerator]
70-
uses: phoenixcontact/tools/.github/workflows/publish-test-coverage-tool.yml@main
71-
with:
72-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
73-
secrets:
74-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
75-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
93+
- name: Setup .NET SDK
94+
uses: actions/setup-dotnet@v1
95+
with:
96+
dotnet-version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
97+
98+
- name: Setup NuGet
99+
uses: NuGet/setup-nuget@v1
76100

77-
# currently not working
78-
# Documentation:
79-
# needs: [EnvVar, UnitTests]
80-
# uses: phoenixcontact/tools/.github/workflows/documentation-tool.yml@main
81-
# with:
82-
# REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
101+
- name: Download package artifacts
102+
uses: actions/download-artifact@v4
103+
with:
104+
name: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}-packages
105+
path: artifacts/packages/
83106

84-
Publish:
85-
needs: [EnvVar, UnitTests]
86-
uses: phoenixcontact/tools/.github/workflows/publish-tool.yml@main
87-
with:
88-
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
89-
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
90-
MORYX_PACKAGE_TARGET_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_DEV }}
91-
MORYX_PACKAGE_TARGET_V3_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_DEV }}
92-
MORYX_PACKAGE_TARGET_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_FUTURE }}
93-
MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_FUTURE }}
94-
MORYX_PACKAGE_TARGET_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_RELEASE }}
95-
MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_RELEASE }}
96-
secrets:
97-
MYGET_TOKEN: ${{secrets.MYGET_TOKEN}}
98-
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}
107+
- name: dotnet push
108+
env:
109+
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}}
110+
MORYX_PACKAGE_TARGET: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_DEV }}
111+
MORYX_PACKAGE_TARGET_V3: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_DEV }}
112+
run: dotnet nuget push "artifacts/packages/" --api-key $MORYX_NUGET_APIKEY --source $MORYX_PACKAGE_TARGET --skip-duplicate --symbol-api-key $MORYX_NUGET_APIKEY --symbol-source $MORYX_PACKAGE_TARGET_V3
113+

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.2.0
1+
8.2.2

0 commit comments

Comments
 (0)