Skip to content

Commit

Permalink
Merge branch 'main' into feature/custom-primitive-types
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Feb 19, 2023
2 parents 2ecb3fe + 9139260 commit 696a647
Show file tree
Hide file tree
Showing 170 changed files with 2,823 additions and 374 deletions.
26 changes: 26 additions & 0 deletions .github/pack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: setup
description: Packs a .NET project

inputs:
project:
description: Path to a .NET project
required: true

runs:
using: composite
steps:
- run: dotnet build --nologo -c Release --no-restore --no-incremental "${{ inputs.project }}"
shell: pwsh
env:
DOTVVM_ROOT: ${{ github.workspace }}
DOTNET_NOLOGO: "1"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"

- run: dotnet pack -c Release --no-build "${{ inputs.project }}"
shell: pwsh
env:
DOTVVM_ROOT: ${{ github.workspace }}
DOTNET_NOLOGO: "1"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
22 changes: 14 additions & 8 deletions .github/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ inputs:
runs:
using: composite
steps:

# nuget
- uses: actions/cache@v2
- uses: nuget/setup-nuget@v1
with:
nuget-version: '6.x'
- uses: actions/cache@v3
id: nuget-cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-

# Node.js
- uses: actions/setup-node@v2
Expand All @@ -34,16 +40,16 @@ runs:
3.1.x
- if: ${{ runner.os == 'Windows' }}
uses: microsoft/[email protected]
- if: ${{ runner.os == 'Windows' }}
run: choco install dotnetcore-3.1-windowshosting -y
shell: pwsh

# restore packages
- if: ${{ runner.os == 'Windows' }}
uses: nuget/setup-nuget@v1
# restore nuget packages
- if: ${{ runner.os == 'Windows' }}
run: msbuild ${{ inputs.sln }} -t:Restore
shell: pwsh
- if: ${{ runner.os != 'Windows' }}
run: dotnet restore ${{ inputs.sln }}
shell: bash

# restore dotnet tools
- run: dotnet tool restore
shell: pwsh
working-directory: src/
7 changes: 7 additions & 0 deletions .github/uitest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ runs:
--config "${{ inputs.build-configuration }}"
--environment "${{ inputs.runtime-environment }}"
shell: bash

- if: ${{ runner.os == 'Windows' }}
run: choco install dotnet-aspnetcoremodule-v2 -y
shell: pwsh
- if: ${{ runner.os == 'Windows' }}
run: iisreset
shell: pwsh
- if: ${{ runner.os == 'Windows' }}
name: uitest.ps1
run: .\.github\uitest\uitest.ps1
Expand Down
15 changes: 15 additions & 0 deletions .github/uitest/uitest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ function Test-Sample {
Sleep 5
}
}

# print out all log files
Export-IISConfiguration -PhysicalPath c:\inetpub -DontExportKeys -Force
foreach ($log in dir c:\inetpub\*.config) {
write-host $log
get-content $log | write-host
}
foreach ($log in dir c:\inetpub\logs\logfiles\*\*.log) {
write-host $log
get-content $log | write-host
}
foreach ($log in dir $root\artifacts\**\*.log) {
write-host $log
get-content $log | write-host
}
throw "The sample '${sampleName}' failed to start."
}
}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Github Actions
name: Run tests

on: ["push"]

Expand All @@ -18,7 +18,7 @@ jobs:
configuration: [Release, Debug]
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
with:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
runs-on: windows-2022
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
- name: MSBuild build
Expand All @@ -88,7 +88,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-2022, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
with:
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
name: JS unit tests
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Node.js
- uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
env:
SLN: "${{ matrix.os == 'windows-2022' && 'src/DotVVM.sln' || 'src/DotVVM.Crossplatform.slnf' }}"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up
uses: ./.github/setup
with:
Expand Down
136 changes: 136 additions & 0 deletions .github/workflows/publish-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: publish-internal

on:
workflow_dispatch:
inputs:
release-type:
type: choice
options:
- InternalPreview
- PublicPreview
- Stable
default: InternalPreview
description: The type of release (determines version format)
required: false
version-core:
type: string
default: "4.1.0"
description: The core part of the version string
required: false
prerelease-version:
type: string
default: preview01
description: The prerelease suffix appended after the core version
required: false
signature-type:
type: choice
options:
- DotNetFoundation
- Riganti
default: DotNetFoundation
description: The signature to be used to sign the packages.
required: false

jobs:
read-input:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: set-version
run: >
if [ "${{ inputs.release-type }}" == 'InternalPreview' ]; then
VERSION="${{ inputs.version-core}}-${{ inputs.prerelease-version }}-${{ github.run_id }}";
elif [ "${{ inputs.release-type }}" == 'PublicPreview' ]; then
VERSION="${{ inputs.version-core}}-${{ inputs.prerelease-version }}-final";
elif [ "${{ inputs.release-type }}" == 'Stable' ]; then
VERSION="${{ inputs.version-core}}-${{ inputs.prerelease-version }}";
else
echo "Unknown release type '${{ inputs.release-type }}'.";
exit 1;
fi;
echo "version=$VERSION" >> $GITHUB_OUTPUT;
outputs:
version: ${{ steps.set-version.outputs.version }}

publish-nuget-packages:
runs-on: windows-2022
needs: read-input
steps:

- uses: actions/checkout@v3

- name: Set up
uses: ./.github/setup

- name: Prepare signclient config
if: ${{ inputs.signature-type == 'DotNetFoundation' }}
run: Write-Output "$env:SIGN_CONFIG" | Out-File "${{ github.workspace }}/signconfig.json"
env:
SIGN_CONFIG: ${{ secrets.SIGN_CONFIG }}
working-directory: ${{ github.workspace }}/src

- name: Add internal NuGet feed
run: ./ci/scripts/Add-InternalNuGetFeed.ps1 `
-internalFeed "${{ secrets.AZURE_ARTIFACTS_FEED }}" `
-internalFeedUser "${{ secrets.AZURE_ARTIFACTS_USERNAME }}" `
-internalFeedPat "${{ secrets.AZURE_ARTIFACTS_PAT }}"

- name: Publish NuGet packages (.NET Foundation)
if: ${{ inputs.signature-type == 'DotNetFoundation' }}
run: ./ci/scripts/Publish-NuGetPackages.ps1 `
-root "${{ github.workspace }}" `
-version "${{ needs.read-input.outputs.version }}" `
-signatureType "DotNetFoundation" `
-dnfUser "${{ secrets.SIGN_USER }}" `
-dnfSecret "${{ secrets.SIGN_SECRET }}"

- name: Publish NuGet packages (Riganti)
if: ${{ inputs.signature-type == 'Riganti' }}
run: ./ci/scripts/Publish-NuGetPackages.ps1 `
-root "${{ github.workspace }}" `
-version "${{ needs.read-input.outputs.version }}" `
-signatureType "Riganti" `
-rigantiUrl "${{ secrets.SIGN_RIGANTI_KEYVAULT_URL }}" `
-rigantiClientId "${{ secrets.SIGN_RIGANTI_CLIENT_ID }}" `
-rigantiTenantId "${{ secrets.SIGN_RIGANTI_TENANT_ID }}" `
-rigantiSecret "${{ secrets.SIGN_RIGANTI_SECRET }}" `
-rigantiCertificate "${{ secrets.SIGN_RIGANTI_CERTIFICATE_NAME }}"

publish-dotvvm-types:
runs-on: windows-2022
needs: read-input
steps:
- uses: actions/checkout@v3

- name: Set up
uses: ./.github/setup

- name: Build Framework
uses: ./.github/pack
with:
project: src/Framework/Framework

- name: Build dotvvm-types
run: npm run tsc-types
working-directory: src/Framework/Framework

- name: Compose dotvvm-types
run: >
mkdir types;
cp "${{ github.workspace }}/src/Framework/Framework/obj/typescript-types/dotvvm.d.ts" types/index.d.ts;
npm version "${{ needs.read-input.outputs.version }}" --no-git-tag-version;
cat "${{ github.workspace }}/ci/scripts/npm/dotvvm-types/package.json";
working-directory: ci/scripts/npm/dotvvm-types

- name: Set internal npm registry
run: >
./ci/scripts/Set-NpmRegistry.ps1 `
-targetDirectory "./ci/scripts/npm/dotvvm-types" `
-registry "${{ secrets.INTERNAL_NPM_REGISTRY }}" `
-pat "${{ secrets.INTERNAL_NPM_PAT }}" `
-username "${{ secrets.INTERNAL_NPM_USERNAME }}" `
-email "${{ secrets.INTERNAL_NPM_EMAIL }}"
- name: Publish dotvvm-types
run: npm publish
working-directory: ci/scripts/npm/dotvvm-types
Loading

0 comments on commit 696a647

Please sign in to comment.