Skip to content

Commit

Permalink
Merge pull request #90 from litetex/develop
Browse files Browse the repository at this point in the history
Prerelease
  • Loading branch information
litetex authored Nov 19, 2022
2 parents 9ec6e86 + 83cd08d commit cead621
Show file tree
Hide file tree
Showing 14 changed files with 258 additions and 83 deletions.
12 changes: 8 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
version: 2
updates:
- package-ecosystem: nuget
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "03:42"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
ignore:
- dependency-name: "*"
# GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "03:42"
open-pull-requests-limit: 10
18 changes: 9 additions & 9 deletions .github/workflows/buildNuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: versionprovider
shell: bash
run: |
echo "::set-output name=version::$(date -u +%Y.%m.%d.%k%M)"
echo "version=$(date -u +%Y.%m.%d.%k%M)" >> $GITHUB_OUTPUT
build_each:
runs-on: ubuntu-latest
Expand All @@ -40,13 +40,13 @@ jobs:
- "CoreFramework.CrashLogging"
- "CoreFramework.Logging"
dotnet-version:
- 3.1.x
- 6.x

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

Expand All @@ -58,21 +58,21 @@ jobs:
- name: Find nupkg file
id: nupkgvar
working-directory: src/${{ matrix.project }}/bin/Release
run: files=( *.nupkg) && echo ::set-output name=filename::$(echo "${files[0]}")
run: files=( *.nupkg) && echo "filename=${files[0]}" >> $GITHUB_OUTPUT

- name: Upload nupkg - Upload asset
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.dotnet-version }}-${{ steps.nupkgvar.outputs.filename }}
path: src/${{ matrix.project }}/bin/Release/${{ steps.nupkgvar.outputs.filename }}

- name: Find snupkg file
id: snupkgvar
working-directory: src/${{ matrix.project }}/bin/Release
run: files=( *.snupkg) && echo ::set-output name=filename::$(echo "${files[0]}")
run: files=( *.snupkg) && echo "filename=${files[0]}" >> $GITHUB_OUTPUT

- name: Upload snupkg - Upload asset
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.dotnet-version }}-${{ steps.snupkgvar.outputs.filename }}
path: src/${{ matrix.project }}/bin/Release/${{ steps.snupkgvar.outputs.filename }}
10 changes: 5 additions & 5 deletions .github/workflows/checkBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
fail-fast: true
matrix:
dotnet-version:
- 3.1.x
- 5.0.x
- 6.x
- 7.x

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

Expand Down
46 changes: 24 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.x

- name: Build
run: dotnet build --configuration Release
Expand All @@ -35,15 +35,16 @@ jobs:
# The maximum value for either of the parts is 65534 - https://stackoverflow.com/a/37941296/11649486
run: |
gen_version=$(date -u +%Y.%m.%d.%k%M)
echo "::set-output name=version::$gen_version"
echo "version=$gen_version" >> $GITHUB_OUTPUT
if [ "${{github.ref}}"="refs/heads/master-release-test" ]; then
echo "${{github.ref}}"
if [ "${{github.ref}}" = "refs/heads/master-release-test" ]; then
gen_package_version="${gen_version}-dev"
elif [ "${{github.ref}}"="refs/heads/master" ]; then
elif [ "${{github.ref}}" = "refs/heads/master" ]; then
gen_package_version="${gen_version}"
fi
echo "::set-output name=packageversion::$gen_package_version"
echo "packageversion=$gen_package_version" >> $GITHUB_OUTPUT
generate_release:
runs-on: ubuntu-latest
Expand All @@ -54,18 +55,19 @@ jobs:
steps:
- id: genoptions
run: |
if [ "${{github.ref}}"="refs/heads/master-release-test" ]; then
echo "${{github.ref}}"
if [ "${{github.ref}}" = "refs/heads/master-release-test" ]; then
draft=false
prerelease=true
elif [ "${{github.ref}}"="refs/heads/master" ]; then
elif [ "${{github.ref}}" = "refs/heads/master" ]; then
draft=true
prerelease=false
fi
echo "::set-output name=prerelease::$prerelease"
echo "::set-output name=draft::$draft"
echo "prerelease=$prerelease" >> $GITHUB_OUTPUT
echo "draft=$draft" >> $GITHUB_OUTPUT
- name: Create Release (draft)
- name: Create Release
id: create_draft
uses: actions/create-release@v1
env:
Expand Down Expand Up @@ -102,12 +104,12 @@ jobs:
- "CoreFramework.Logging"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.x

- name: Pack
working-directory: src/${{ matrix.project }}
Expand All @@ -117,21 +119,21 @@ jobs:
- name: Find nupkg file
id: nupkgvar
working-directory: src/${{ matrix.project }}/bin/Release
run: files=( *.nupkg) && echo ::set-output name=filename::$(echo "${files[0]}")
run: files=( *.nupkg) && echo "filename=${files[0]}" >> $GITHUB_OUTPUT

- name: Upload nupkg - Upload asset
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ steps.nupkgvar.outputs.filename }}
path: src/${{ matrix.project }}/bin/Release/${{ steps.nupkgvar.outputs.filename }}

- name: Find snupkg file
id: snupkgvar
working-directory: src/${{ matrix.project }}/bin/Release
run: files=( *.snupkg) && echo ::set-output name=filename::$(echo "${files[0]}")
run: files=( *.snupkg) && echo "filename=${files[0]}" >> $GITHUB_OUTPUT

- name: Upload snupkg - Upload asset
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ steps.snupkgvar.outputs.filename }}
path: src/${{ matrix.project }}/bin/Release/${{ steps.snupkgvar.outputs.filename }}
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Sonar CI

on:
workflow_dispatch:
push:
branches: [ master, develop ]
paths-ignore:
- '**.md'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'

jobs:
sonar:
name: SonarCloud Scan
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11.x

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x

- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar-fix2
restore-keys: ${{ runner.os }}-sonar-fix2

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v3
with:
path: .\src\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner-fix2
restore-keys: ${{ runner.os }}-sonar-scanner-fix2

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
working-directory: src
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: src
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"litetex_CoreFrameworkBase" /o:"litetex" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build --configuration Release
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
Expand Down
Loading

0 comments on commit cead621

Please sign in to comment.