Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Jul 14, 2023
1 parent 9d9f9af commit f2a6026
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
Deterministic: true

jobs:
before_build:
common:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.version.outputs.version }}
Expand All @@ -25,9 +25,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update path
run: echo ":/github/home/.dotnet/tools" >> $GITHUB_PATH
- run: dotnet tool install -g GitVersion.Tool --version 5.10.1 --ignore-failed-sources
- run: echo ":/github/home/.dotnet/tools" >> $GITHUB_PATH
- run: dotnet tool install -g GitVersion.Tool --version 5.12.0
- name: Resolve version
id: version
run: |
Expand All @@ -40,68 +39,69 @@ jobs:
echo "Resolved version3: $version3"
echo "version=${version}" >> $GITHUB_OUTPUT
echo "version3=${version3}" >> $GITHUB_OUTPUT
echo "Version=$version" >> $GITHUB_ENV
- run: dotnet restore CommandLine.sln
- run: dotnet build CommandLine.sln --no-restore
- run: |
dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info --exclude-diagnostics \
IDE0220 \
IDE0251 \
IDE0270
# IDE0220 - 'foreach' statement implicitly converts type. Add an explicit cast to make intent clearer.
# IDE0251 - Property can be made read-only.
# IDE0270 - Null check can be simplified.
- run: dotnet restore Roslynator.sln
- run: dotnet build Roslynator.sln --no-restore
- run: |
dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info --exclude-diagnostics \
IDE0220 \
IDE0251 \
IDE0270
# IDE0220 - 'foreach' statement implicitly converts type. Add an explicit cast to make intent clearer.
# IDE0251 - Property can be made read-only.
# IDE0270 - Null check can be simplified.
- run: dotnet tool install -g roslynator.dotnet.cli
- run: roslynator analyze Roslynator.sln --severity-level info --ignored-diagnostics CS1591 CS8019
- run: dotnet test Roslynator.sln --no-build

build_framework_cli:
needs: before_build
needs: common
runs-on: windows-latest
env:
# WarningsNotAsErrors: ${{ github.env.WarningsNotAsErrors }},NU5128
WarningsNotAsErrors: ${{ github.env.WarningsNotAsErrors }},NU5128
RoslynatorCommandLine: true
RoslynatorCliVersion: ${{ needs.common.outputs.version }}
RoslynatorCliPackageVersion: ${{ needs.common.outputs.version }}
defaults:
run:
working-directory: src/CommandLine
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet publish --no-restore /p:RoslynatorCliVersion=${{ needs.before_build.outputs.version }}
- run: dotnet pack --no-build /p:RoslynatorCliPackageVersion=${{ needs.before_build.outputs.version }}
- run: dotnet publish --no-restore
- run: dotnet pack --no-build
- uses: actions/upload-artifact@v3
with:
name: nuget_packages
path: src/CommandLine/bin/Release/*.nupkg

build_core_cli:
needs: before_build
needs: common
runs-on: ubuntu-20.04
env:
RoslynatorDotNetCli: true
RoslynatorCliVersion: ${{ needs.common.outputs.version }}
RoslynatorCliPackageVersion: ${{ needs.common.outputs.version }}
defaults:
run:
working-directory: src/CommandLine
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet build --no-restore /p:RoslynatorCliVersion=${{ needs.before_build.outputs.version }}
- run: dotnet pack --no-build /p:RoslynatorCliPackageVersion=${{ needs.before_build.outputs.version }}
- run: dotnet build --no-restore
- run: dotnet pack --no-build
- uses: actions/upload-artifact@v3
with:
name: nuget_packages
path: src/CommandLine/bin/Release/*.nupkg

build_core_and_testing:
needs: before_build
needs: common
runs-on: ubuntu-20.04
defaults:
run:
Expand All @@ -110,7 +110,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore Roslynator.CoreAndTesting.slnf
- run: dotnet build Roslynator.CoreAndTesting.slnf --no-restore
- run: dotnet pack Roslynator.CoreAndTesting.slnf --no-build -o _nupkg
Expand All @@ -120,7 +120,7 @@ jobs:
path: src/_nupkg/*nupkg

build_analyzers:
needs: before_build
needs: common
strategy:
matrix:
component:
Expand All @@ -138,7 +138,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet build --no-restore /p:Roslynator${{ matrix.component.propertyName }}NuGet=true
- run: dotnet pack --no-build
Expand All @@ -149,7 +149,7 @@ jobs:
path: src/${{ matrix.component.name }}.CodeFixes/bin/Release/*.nupkg

build_vs_extension:
needs: before_build
needs: common
runs-on: windows-latest
defaults:
run:
Expand All @@ -158,8 +158,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: (Get-Content source.extension.vsixmanifest) -replace 'Version="1.0.0"', 'Version="${{ needs.before_build.outputs.version3 }}"' | Set-Content source.extension.vsixmanifest
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: (Get-Content source.extension.vsixmanifest) -replace 'Version="1.0.0"', 'Version="${{ needs.common.outputs.version3 }}"' | Set-Content source.extension.vsixmanifest
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore
- uses: microsoft/setup-msbuild@v1.1 # https://github.com/microsoft/setup-msbuild
- run: msbuild
Expand All @@ -169,7 +169,7 @@ jobs:
path: src/VisualStudio/bin/Release/net472/*.vsix

build_vs_code_extension:
needs: [ before_build, build_analyzers ]
needs: [ common, build_analyzers ]
runs-on: ubuntu-20.04
defaults:
run:
Expand All @@ -178,7 +178,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "Version=${{ needs.before_build.outputs.version }}" >> $GITHUB_ENV
- run: echo "Version=${{ needs.common.outputs.version }}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet build --no-restore /p:DefineConstants=VSCODE
- run: |
Expand All @@ -199,7 +199,7 @@ jobs:
cp bin/Release/netstandard2.0/Roslynator.CSharp.CodeFixes.dll package/roslyn/fixes
name: Copy DLLs to package
- run: >
sed -i 's/"version": "1.0.0"/"version": "${{ needs.before_build.outputs.version3 }}"/' package/package.json
sed -i 's/"version": "1.0.0"/"version": "${{ needs.common.outputs.version3 }}"/' package/package.json
- run: npm install
working-directory: src/VisualStudioCode/package
- run: npm install -g @vscode/vsce
Expand All @@ -210,7 +210,7 @@ jobs:
name: vsix_packages
path: src/VisualStudioCode/package/*.vsix
- run: sed -i s/ms-dotnettools.csharp/muhammad-sammy.csharp/ package/package.json
- run: vsce package -o roslynator-${{ needs.before_build.outputs.version3 }}-ovsx.vsix
- run: vsce package -o roslynator-${{ needs.common.outputs.version3 }}-ovsx.vsix
working-directory: src/VisualStudioCode/package
- uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit f2a6026

Please sign in to comment.