-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from AElfProject/release/1.0.0
Release v1.0.0
- Loading branch information
Showing
36 changed files
with
1,288 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publish NuGet Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Get the version from git tags | ||
id: get_version | ||
run: | | ||
TAG=$(git describe --tags --abbrev=0) | ||
VERSION=${TAG#v} | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Build the project | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Pack the NuGet package | ||
run: dotnet pack --configuration Release --no-build --output ./nupkg -p:PackageVersion=${{ env.VERSION }} | ||
|
||
- name: Publish the NuGet package | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test with code coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
env: | ||
DOTNET_INSTALL_DIR: "./.dotnet" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
services: | ||
elasticsearch: | ||
image: elasticsearch:7.17.0 | ||
ports: | ||
- 9200:9200 | ||
options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '7.0' | ||
- name: Verify Elasticsearch connection | ||
env: | ||
ELASTIC_SEARCH_URL: http://127.0.0.1:${{ job.services.elasticsearch.ports[9200] }} | ||
run: | | ||
echo $ELASTIC_SEARCH_URL | ||
curl -fsSL "$ELASTIC_SEARCH_URL/_cat/health?h=status" | ||
- name: Install dependencies | ||
run: dotnet restore --verbosity quiet | ||
|
||
- name: Build | ||
run: dotnet build --no-restore /clp:ErrorsOnly /p:GeneratePackageOnBuild=false --verbosity quiet | ||
|
||
- name: Test | ||
run: | | ||
for name in `ls ./test/*.Tests/*.csproj | awk '{print $NF}'`; | ||
do | ||
dotnet test ${name} --no-restore --no-build --logger trx --settings CodeCoverage.runsettings --results-directory coverage --collect:"XPlat Code Coverage" | ||
done | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: coverage/*/coverage.cobertura.xml | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.