-
-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (119 loc) · 3.86 KB
/
preview.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Publish Preview
on:
workflow_dispatch:
inputs:
reason:
description: 'Reason for running the action'
required: false
default: 'Pre-Release'
private:
description: 'Whether to publish to the private feed'
required: false
default: 'true'
public:
description: 'Whether to publish to the public NuGet feed'
required: false
default: 'false'
env:
APNSTEST__BUNDLEID: ${{ vars.APNSTEST__BUNDLEID }}
APNSTEST__DEVICETOKEN: ${{ secrets.APNSTEST__DEVICETOKEN }}
APNSTEST__ENVIRONMENT: 'Production'
APNSTEST__KEYID: ${{ secrets.APNSTEST__KEYID }}
APNSTEST__PRIVATEKEY: ${{ secrets.APNSTEST__PRIVATEKEY }}
APNSTEST__TEAMID: ${{ vars.APNSTEST__TEAMID }}
FCMLEGACYTEST__KEY: ${{ secrets.FCMLEGACYTEST__KEY }}
FCMLEGACYTEST__REGISTRATIONID: ${{ secrets.FCMLEGACYTEST__REGISTRATIONID }}
FIREBASETEST__CLIENTEMAIL: ${{ secrets.FIREBASETEST__CLIENTEMAIL }}
FIREBASETEST__DEVICETOKEN: ${{ secrets.FIREBASETEST__DEVICETOKEN }}
FIREBASETEST__PRIVATEKEY: ${{ secrets.FIREBASETEST__PRIVATEKEY }}
FIREBASETEST__PROJECTID: ${{ vars.FIREBASETEST__PROJECTID }}
FIREBASETEST__TOKENURI: ${{ vars.FIREBASETEST__TOKENURI }}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
id: gitversion
with:
useConfigFile: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '7'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build
- name: Pack
run: >
dotnet pack
--configuration Release
--no-build
--output ${{ github.workspace }}/drop
-p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
-p:VersionPrefix=${{ steps.gitversion.outputs.nuGetVersion }}
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/drop/*
name: drop
PrivateFeed:
runs-on: ubuntu-latest
needs: Build
if: ${{ github.event.inputs.private == 'true' }}
steps:
- uses: actions/download-artifact@v4
with:
name: drop
path: ${{ github.workspace }}/drop
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
source-url: ${{ secrets.PRIVATE_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.PRIVATE_FEED_API_KEY }}
- name: Publish to private feed
# if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "${{ github.workspace }}/drop/*"
-k ${{ secrets.PRIVATE_FEED_API_KEY }}
--skip-duplicate
PublicFeed:
runs-on: ubuntu-latest
needs: Build
if: ${{ github.event.inputs.public == 'true' }}
steps:
- uses: actions/download-artifact@v4
with:
name: drop
path: ${{ github.workspace }}/drop
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Publish to NuGet.org
# if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "${{ github.workspace }}/drop/*"
-k ${{ secrets.NUGET_API_KEY }}
--skip-duplicate