Skip to content

Commit

Permalink
Merge branch 'master' into add-string-methods
Browse files Browse the repository at this point in the history
* master:
  Update action steps and fixed myget (neo-project#838)
  add IsEven (neo-project#837)
  Storage backed properties (neo-project#745)
  Fix: ensure the value in range (neo-project#828)
  • Loading branch information
Jim8y committed Dec 18, 2023
2 parents 5d508b9 + 1577838 commit 9b83226
Show file tree
Hide file tree
Showing 15 changed files with 1,072 additions and 94 deletions.
72 changes: 52 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: .NET Core Test and Publish

on:
push:
branches: master
branches: [master]
pull_request:

env:
Expand All @@ -14,20 +14,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
run: dotnet build ./neo-devpack-dotnet.sln
- name: Check format
run: |
dotnet format --verify-no-changes --verbosity diagnostic
dotnet format --no-restore --verify-no-changes --verbosity diagnostic
- name: Add package coverlet.msbuild
run: find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
- name: Test Neo.Compiler.CSharp.UnitTests
run: dotnet test tests/Neo.Compiler.CSharp.UnitTests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/
run: |
dotnet test ./tests/Neo.Compiler.CSharp.UnitTests \
--no-build \
-p:CollectCoverage=true \
-p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/
- name: Test Neo.SmartContract.Framework.UnitTests
run: dotnet test tests/Neo.SmartContract.Framework.UnitTests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json /p:Exclude=\"[Neo.Compiler.CSharp.UnitTests]*\" /p:CoverletOutputFormat=lcov
run: |
dotnet test ./tests/Neo.SmartContract.Framework.UnitTests \
--no-build \
-p:CollectCoverage=true \
-p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov \
-p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json \
-p:Exclude=\"[Neo.Compiler.CSharp.UnitTests]*\" \
-p:CoverletOutputFormat=lcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand All @@ -40,49 +55,66 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1
with:
nuget-version: latest
- name: Pack with dotnet
run: git rev-list --count HEAD | xargs printf "CI%05d" | xargs dotnet pack src/Neo.SmartContract.Framework -c Debug -o out --include-source --version-suffix
- name: Publish to Github Packages
run: |
nuget source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/neo-project/index.json" -UserName neo-project -Password ${GITHUB_TOKEN}
nuget source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/neo-project/index.json" -UserName neo-project -Password "${{ secrets.GITHUB_TOKEN }}"
nuget push out/*.nupkg -Source "GitHub"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PublishMyGet:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Pack with dotnet
run: git rev-list --count HEAD |xargs printf "CI%05d" |xargs dotnet pack src/Neo.SmartContract.Framework -c Debug -o out --include-source --version-suffix
- name: Set Version
run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV
- name: Pack Package(s)
run: |
dotnet pack ./src/Neo.SmartContract.Framework \
--configuration Debug \
--output ./out \
--version-suffix ${{ env.VERSION_SUFFIX }}
- name: Publish to MyGet
run: dotnet nuget push out/*.nupkg -s https://www.myget.org/F/neo/api/v2/package -k ${MYGET_TOKEN} -ss https://www.myget.org/F/neo/symbols/api/v2/package -sk ${MYGET_TOKEN}
env:
MYGET_TOKEN: ${{ secrets.MYGET_TOKEN }}
working-directory: ./out
run: |
for filename in *.nupkg; do
dotnet nuget push "${filename}" \
--source https://www.myget.org/F/neo/api/v3/index.json \
--api-key "${{ secrets.MYGET_TOKEN }}" \
--disable-buffering \
--no-service-endpoint;
done;
shell: bash

Release:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: get_version
run: |
Expand All @@ -103,7 +135,7 @@ jobs:
prerelease: ${{ contains(steps.get_version.outputs.version, '-') }}
- name: Setup .NET Core
if: steps.check_tag.outputs.statusCode == '404'
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish to NuGet
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "7.0.404",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
Loading

0 comments on commit 9b83226

Please sign in to comment.