Skip to content

Commit

Permalink
Merge pull request #3 from lschoenepxc/main
Browse files Browse the repository at this point in the history
Replacing PS-Script and Switch to Ubuntu
  • Loading branch information
1nf0rmagician authored Jun 14, 2023
2 parents 1a82246 + c72dcc0 commit 11fe6a7
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 979 deletions.
680 changes: 0 additions & 680 deletions .build/BuildToolkit.ps1

This file was deleted.

31 changes: 0 additions & 31 deletions .build/Common.props

This file was deleted.

36 changes: 0 additions & 36 deletions .build/Output.ps1

This file was deleted.

Binary file removed .build/moryx-logo.png
Binary file not shown.
118 changes: 56 additions & 62 deletions .github/workflows/build-and-test-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,94 +12,88 @@ on:
branches:
- dev
- future

env:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
MORYX_PACKAGE_TARGET_DEV: 'https://www.myget.org/F/moryx/api/v2/package'
MORYX_PACKAGE_TARGET_V3_DEV: 'https://www.myget.org/F/moryx/api/v3/index.json'
MORYX_PACKAGE_TARGET_FUTURE: 'https://www.myget.org/F/moryx-future/api/v2/package'
MORYX_PACKAGE_TARGET_V3_FUTURE: 'https://www.myget.org/F/moryx-future/api/v3/index.json'
MORYX_PACKAGE_TARGET_RELEASE: 'https://api.nuget.org/v3/index.json'
MORYX_PACKAGE_TARGET_V3_RELEASE: 'https://api.nuget.org/v3/index.json'

jobs:
EnvVar:
runs-on: ubuntu-latest
steps:
- run: echo ""
outputs:
dotnet_sdk_version: ${{ env.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}
MORYX_PACKAGE_TARGET_DEV: ${{ env.MORYX_PACKAGE_TARGET_DEV }}
MORYX_PACKAGE_TARGET_V3_DEV: ${{ env.MORYX_PACKAGE_TARGET_V3_DEV }}
MORYX_PACKAGE_TARGET_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_FUTURE }}
MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_V3_FUTURE }}
MORYX_PACKAGE_TARGET_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_RELEASE }}
MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_V3_RELEASE }}

Build:
uses: PHOENIXCONTACT/tools/.github/workflows/build-tool.yml@main
needs: [EnvVar]
uses: phoenixcontact/tools/.github/workflows/build-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

UnitTests:
needs: [Build]
uses: PHOENIXCONTACT/tools/.github/workflows/unittest-tool.yml@main
needs: [EnvVar, Build]
uses: phoenixcontact/tools/.github/workflows/unittest-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

IntegrationTests:
needs: [Build]
uses: PHOENIXCONTACT/tools/.github/workflows/integrationtest-tool.yml@main
needs: [EnvVar, Build]
uses: phoenixcontact/tools/.github/workflows/integrationtest-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

ReportGenerator:
needs: [UnitTests, IntegrationTests]
uses: PHOENIXCONTACT/tools/.github/workflows/reportgenerator-tool.yml@main
needs: [EnvVar, UnitTests, IntegrationTests]
uses: phoenixcontact/tools/.github/workflows/reportgenerator-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

Publish-Test-Coverage:
needs: [ReportGenerator]
uses: PHOENIXCONTACT/tools/.github/workflows/publish-test-coverage-tool.yml@main
needs: [EnvVar, ReportGenerator]
uses: phoenixcontact/tools/.github/workflows/publish-test-coverage-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Documentation:
needs: [UnitTests]
uses: PHOENIXCONTACT/tools/.github/workflows/documentation-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
# currently not working with .Net 8 and in Framework-repo
# Documentation:
# needs: [EnvVar, UnitTests]
# uses: phoenixcontact/tools/.github/workflows/documentation-tool.yml@main
# with:
# REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}

Publish:
needs: [UnitTests]
uses: PHOENIXCONTACT/tools/.github/workflows/publish-tool.yml@main
needs: [EnvVar, UnitTests]
uses: phoenixcontact/tools/.github/workflows/publish-tool.yml@main
with:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '7.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
REPOSITORY_NAME: ${{ github.event.repository.name }}
dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }}
REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }}
MORYX_PACKAGE_TARGET_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_DEV }}
MORYX_PACKAGE_TARGET_V3_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_DEV }}
MORYX_PACKAGE_TARGET_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_FUTURE }}
MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_FUTURE }}
MORYX_PACKAGE_TARGET_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_RELEASE }}
MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_RELEASE }}
secrets:
MYGET_TOKEN: ${{secrets.MYGET_TOKEN}}
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}

91 changes: 62 additions & 29 deletions .github/workflows/build-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,80 @@ on:
REPOSITORY_NAME:
required: true
type: string
MORYX_OPTIMIZE_CODE:
required: false
type: string
MORYX_BUILD_CONFIG:
required: false
type: string
MORYX_BUILDNUMBER:
required: false
type: string
DOTNET_SKIP_FIRST_TIME_EXPERIENCE:
required: false
type: boolean


jobs:
Build:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ inputs.dotnet_sdk_version }}
# - name: Setup .NET SDK
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 6.x

- name: Setup Node version
uses: actions/setup-node@v3
with:
node-version: 16

- name: Build
shell: pwsh
env:
MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}}
MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}}
MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}}
run: ./Build.ps1 -Build -Pack
- name: Setup .NET SDK standard (7)
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ inputs.dotnet_sdk_version }}

- name: Clean
run: dotnet clean && dotnet nuget locals all --clear

- name: Execute dotnet restore
run: dotnet restore

- name: Execute dotnet build
if: ${{ !(startsWith(github.ref, 'refs/tags/v')) }}
run: |
ASSEMBLY_VERSION="$(cat VERSION)"
ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0
echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}"
FILE_VERSION="$(cat VERSION)"."${{github.run_number}}"
echo "FILE_VERSION = ${FILE_VERSION}"
INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}"
dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION
- name: Execute dotnet build (Release)
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
ASSEMBLY_VERSION="${{github.ref_name}}"
ASSEMBLY_VERSION="${ASSEMBLY_VERSION#v}"
ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0
echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}"
FILE_VERSION="$(cat VERSION)"."${{github.run_number}}"
echo "FILE_VERSION = ${FILE_VERSION}"
INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}"
dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION
- name: Execute dotnet pack with release version
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
RELEASE_VERSION="${{github.ref_name}}"
RELEASE_VERSION="${RELEASE_VERSION#v}"
echo "RELEASE_VERSION = ${RELEASE_VERSION}"
dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$RELEASE_VERSION
- name: Execute dotnet pack with production version (dev or future)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future'}}
run: |
PRODUCTION_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
echo "PRODUCTION_VERSION = ${PRODUCTION_VERSION}"
dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$PRODUCTION_VERSION
- name: Upload package artifacts
uses: actions/upload-artifact@v2
with:
name: packages
path: artifacts/Packages/
retention-days: 1
name: ${{inputs.REPOSITORY_NAME}}-packages
path: artifacts/packages/
retention-days: 1
37 changes: 11 additions & 26 deletions .github/workflows/documentation-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,28 @@ name: Documentation
on:
workflow_call:
inputs:
dotnet_sdk_version:
required: true
type: string
REPOSITORY_NAME:
required: true
type: string
MORYX_OPTIMIZE_CODE:
required: false
type: string
MORYX_BUILD_CONFIG:
required: false
type: string
MORYX_BUILDNUMBER:
required: false
type: string
DOTNET_SKIP_FIRST_TIME_EXPERIENCE:
required: false
type: boolean

jobs:
Documentation:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Generate docFx
shell: pwsh
env:
MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}}
MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}}
MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}}
run: ./Build.ps1 -GenerateDocs
- uses: nuget/setup-nuget@v1
with:
nuget-version: latest

- name: Build Documentation
uses: nunit/[email protected]
with:
args: docs/docfx.json

- name: Upload documentation results
uses: actions/upload-artifact@v2
with:
name: documentation
path: artifacts/Documentation/
name: ${{inputs.REPOSITORY_NAME}}-documentation
path: docs/_site
retention-days: 2
Loading

0 comments on commit 11fe6a7

Please sign in to comment.