4
4
release :
5
5
types :
6
6
- published
7
- - edited
8
7
9
8
env :
10
9
VERSION : ' '
11
- BRANCH : ' '
10
+ BRANCH : ' main '
12
11
13
12
jobs :
14
13
build :
@@ -23,45 +22,49 @@ jobs:
23
22
setAllVars : true
24
23
- name : Setting VERSION and BRANCH env
25
24
run : |
26
- echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion "
25
+ echo "::set-env name=VERSION::$NBGV_SimpleVersion$NBGV_PrereleaseVersion "
27
26
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
28
27
- name : Update tokens in project files
29
28
uses : cschleiden/replace-tokens@v1
30
29
with :
31
30
files : ' ["*.csproj", "**/*.csproj"]'
32
31
- uses : actions/setup-dotnet@v1
33
32
with :
34
- dotnet-version : ' 3.1.202'
35
- source-url : https://api.nuget.org/v3/index.json
36
- env :
37
- NUGET_AUTH_TOKEN : ${{secrets.NUGET_KEY}}
33
+ dotnet-version : ' 3.1.202'
38
34
- name : Building library
39
35
run : |
40
36
dotnet restore src
41
- dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
42
- dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
43
- dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
44
- dotnet build src/bunit.testassets/ -c Release --no-restore
37
+ dotnet build src/bunit.core/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
38
+ dotnet build src/bunit.web/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
39
+ dotnet build src/bunit.xunit/ -c Release --no-restore -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
40
+ dotnet build src/bunit.testassets/ -c Release --no-restore
45
41
- name : Running unit tests
46
42
run : |
47
43
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
48
44
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
49
45
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
50
46
- name : Creating library package
51
47
run : |
52
- dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
53
- dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
54
- dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
55
- dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
48
+ dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
49
+ dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
50
+ dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
51
+ dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
56
52
- name : Buidling template package
57
- run : dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
53
+ run : dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
58
54
- name : Verifying template
59
55
run : |
60
56
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
61
57
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
62
58
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
63
59
dotnet test ${GITHUB_WORKSPACE}/Test
64
- # - name: Push packages to NuGet
65
- # run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
60
+ - name : Push packages to NuGet
61
+ run : dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
62
+ - name : Push packages to GitHub Package Registry
63
+ run : |
64
+ for f in ${GITHUB_WORKSPACE}/packages/*.nupkg
65
+ do
66
+ curl -vX PUT -u "egil:${{ secrets.GITHUB_TOKEN }}" -F package=@$f https://nuget.pkg.github.com/egil/
67
+ done
68
+ shell : bash
66
69
# - name: Push packages to GitHub Package Registry
67
- # run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate
70
+ # run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/egil/index.json --skip-duplicate
0 commit comments