Skip to content

Commit 3818dfb

Browse files
committed
update build process
- makes better use of msbuild - use github actions to manage
1 parent 0f178b3 commit 3818dfb

18 files changed

Lines changed: 1216 additions & 1155 deletions

File tree

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- "*"
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Test
27+
shell: pwsh
28+
run: dotnet test -c Release
29+
30+
- name: Package
31+
shell: pwsh
32+
run: dotnet pack -c Release -o packages
33+
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
name: application
37+
path: packages/*.*
38+
39+
# publish to github pacakge repository
40+
- uses: actions/setup-node@v2
41+
with:
42+
node-version: '12.x'
43+
registry-url: 'https://npm.pkg.github.com'
44+
45+
- run: npm publish packages/*.tgz
46+
env:
47+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Publish the package to GPR
50+
run: dotnet nuget push packages/*.nupkg -s https://nuget.pkg.github.com/tocsoft/index.json -k ${{secrets.GITHUB_TOKEN}}
51+
52+
53+
#publish to npm & nuget
54+
- uses: actions/setup-node@v1
55+
if: github.event_name == 'release' && github.event.action == 'created'
56+
with:
57+
node-version: '10.x'
58+
registry-url: 'https://registry.npmjs.org'
59+
- run: npm publish packages/*.tgz --access public
60+
if: github.event_name == 'release' && github.event.action == 'created'
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63+
64+
- name: Publish the package to nuget.org
65+
if: github.event_name == 'release' && github.event.action == 'created'
66+
run: dotnet nuget push packages/*.nupkg -k ${{secrets.NUGET_TOKEN}}

0 commit comments

Comments
 (0)