Skip to content

Commit ae42cfb

Browse files
committed
updated to workflow
1 parent 56d1170 commit ae42cfb

2 files changed

Lines changed: 65 additions & 63 deletions

File tree

.github/.force-nuget-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3
1+
4

.github/workflows/RELEASE.yml

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,67 @@
1-
# name: RELEASE
1+
name: RELEASE
22

3-
# on:
4-
# release:
5-
# types:
6-
# - published
7-
# - edited
3+
on:
4+
release:
5+
types:
6+
- published
7+
- edited
88

9-
# env:
10-
# VERSION: ''
11-
# BRANCH: ''
9+
env:
10+
VERSION: ''
11+
BRANCH: ''
1212

13-
# jobs:
14-
# build:
15-
# name: Build and verify library
16-
# runs-on: ubuntu-latest
17-
# steps:
18-
# - uses: actions/checkout@v2
19-
# with:
20-
# fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
21-
# - uses: dotnet/nbgv@master
22-
# with:
23-
# setAllVars: true
24-
# - name: Setting VERSION and BRANCH env
25-
# run: |
26-
# echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
27-
# echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
28-
# - name: Update tokens in project files
29-
# uses: cschleiden/replace-tokens@v1
30-
# with:
31-
# files: '["*.csproj", "**/*.csproj"]'
32-
# - uses: actions/setup-dotnet@v1
33-
# 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}}
38-
# - name: Building library
39-
# run: |
40-
# 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
45-
# - name: Running unit tests
46-
# run: |
47-
# dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
48-
# dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
49-
# dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
50-
# - name: Creating library package
51-
# 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
56-
# - name: Buidling template package
57-
# run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
58-
# - name: Verifying template
59-
# run: |
60-
# dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
61-
# dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
62-
# dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
63-
# dotnet test ${GITHUB_WORKSPACE}/Test
64-
# - name: Push packages to GitHub Packages
65-
# run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/'*.nupkg' --skip-duplicate
13+
jobs:
14+
build:
15+
name: Build and verify library
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
21+
- uses: dotnet/nbgv@master
22+
with:
23+
setAllVars: true
24+
- name: Setting VERSION and BRANCH env
25+
run: |
26+
echo "::set-env name=VERSION::$NBGV_NuGetPackageVersion"
27+
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
28+
- name: Update tokens in project files
29+
uses: cschleiden/replace-tokens@v1
30+
with:
31+
files: '["*.csproj", "**/*.csproj"]'
32+
- uses: actions/setup-dotnet@v1
33+
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}}
38+
- name: Building library
39+
run: |
40+
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
45+
- name: Running unit tests
46+
run: |
47+
dotnet test src/bunit.core.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
48+
dotnet test src/bunit.web.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
49+
dotnet test src/bunit.xunit.tests/ -c Release --no-restore --verbosity normal /nowarn:CS1591
50+
- name: Creating library package
51+
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
56+
- name: Buidling template package
57+
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
58+
- name: Verifying template
59+
run: |
60+
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
61+
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
62+
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
63+
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
66+
# - 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

0 commit comments

Comments
 (0)