Update README table #181
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
name: Build | |
on: [push, pull_request] | |
env: | |
SHA: ${{ GITHUB.SHA }} | |
REF: ${{ GITHUB.REF }} | |
RUN_ID: ${{ GITHUB.RUN_ID }} | |
RUN_NUMBER: ${{ GITHUB.RUN_NUMBER }} | |
BUILD_RUN_NUMBER: build.${{ GITHUB.RUN_NUMBER }} | |
GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} | |
COVERALLS_REPO_TOKEN: ${{ SECRETS.COVERALLS_REPO_TOKEN }} | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
7.0.x | |
include-prerelease: true | |
- name: Check .NET info | |
run: dotnet --info | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build solution | |
run: dotnet build -c Release --no-restore | |
- name: Test solution | |
run: dotnet test -c Release --no-build --no-restore --results-directory test-results --verbosity normal --collect:"XPlat Code Coverage" ` | |
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover | |
- name: Upload test results artefacts | |
if: github.repository_owner == 'casdoor' && github.event_name == 'push' | |
uses: actions/[email protected] | |
with: | |
name: "drop-ci-test-results" | |
path: './test-results' | |
dry-run-semantic-release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.repository_owner == 'casdoor' && github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Dry run semantic-release | |
run: | | |
export PATH=$PATH:$(yarn global bin) | |
yarn global add [email protected] | |
semantic-release --dry-run | |
release-build-version: | |
runs-on: windows-latest | |
needs: build | |
if: github.repository_owner == 'casdoor' && github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Git fetch tags | |
run: git fetch --tags | |
- name: Check tags | |
run: git tag -l -n | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
7.0.x | |
include-prerelease: true | |
- name: Check .NET info | |
run: dotnet --info | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build solution | |
run: dotnet build -c Release --no-restore | |
- name: Pack packages | |
run: | | |
$LastTag = git describe --tags (git rev-list --tags --max-count=1); | |
if (!$LastTag) { | |
$LastTag = "v1.0.0"; | |
} | |
echo "Last tag is: $LastTag"; | |
$Version = ($LastTag).TrimStart('v'); | |
echo "Publishing version: $Version"; | |
$NowBranchName = git rev-parse --abbrev-ref HEAD; | |
echo "Now branch name: $NowBranchName"; | |
$PackageVersion = ($LastTag).TrimStart('v') + "-" + $env:BUILD_RUN_NUMBER + "." + $NowBranchName + "." + $env:SHA.SubString(0, 7); | |
$PackageVersion = $PackageVersion.Replace("#", "."); | |
echo "Publishing package version: ${PackageVersion}"; | |
dotnet pack -c Release -o packages /p:PackageVersion=$PackageVersion /p:Version=$Version; | |
- name: Upload packages artefacts | |
uses: actions/[email protected] | |
with: | |
name: "drop-ci-build-packages" | |
path: './packages' |