forked from aritchie/userdialogs
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.8 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and publish
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install workloads
run: dotnet workload install -s https://api.nuget.org/v3/index.json android ios
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '17'
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build number
run: echo "Build $env:GITHUB_RUN_NUMBER"
- name: Build
run: msbuild src/Acr.UserDialogs /p:Configuration=Release /p:BUILD_BUILDNUMBER=$env:GITHUB_RUN_NUMBER /restore
- name: Pack
run: msbuild src/Acr.UserDialogs /p:Configuration=Release /p:BUILD_BUILDNUMBER=$env:GITHUB_RUN_NUMBER /t:Pack
- uses: actions/upload-artifact@master
with:
name: build-artifacts
path: src/Acr.UserDialogs/bin
publish:
permissions:
packages: write
needs: build
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
include-prerelease: true
- uses: actions/download-artifact@master
with:
name: build-artifacts
path: src/Acr.UserDialogs/bin
- name: Publish
if: ${{ github.event_name == 'push' }}
env:
token: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet nuget add source https://nuget.pkg.github.com/emclient/index.json -n github
find src/Acr.UserDialogs/bin/Release -name '*.nupkg' | xargs -i dotnet nuget push {} -s github --api-key ${{ secrets.GITHUB_TOKEN }}