-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (59 loc) · 2.39 KB
/
xamarin-ui-publish.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
name: Publish-Nuget
on:
workflow_call:
inputs:
app-version:
required: true
type: string
configuration:
required: true
type: string
jobs:
publish:
name: Publish Nuget
runs-on: [self-hosted, xamarin-android]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v3
- name: Modify AssemblyInfo files
uses: mingjun97/file-regex-replace@v1
with:
regex: 'AssemblyVersion\("(.*?)"\)'
replacement: 'AssemblyVersion("${{ inputs.app-version }}")'
include: 'AssemblyInfo.cs'
- name: Modify Nuget Version
uses: mingjun97/file-regex-replace@v1
with:
regex: '<Version>.*<\/Version>'
replacement: '<Version>${{ inputs.app-version }}</Version>'
include: 'Smartway.UiComponent.nuspec'
- name: Nuget - Restore packages
run: nuget restore Smartway.UiComponent.sln
- name: MsBuild - Compile
run: msbuild Smartway.UiComponent.sln -p:Configuration=${{ inputs.configuration }} -clp:Summary
- name: Pack Nuget
run: "nuget pack Smartway.UiComponent.nuspec -Version ${{ inputs.app-version}} -Properties Configuration=${{ inputs.configuration }}"
- name: Publish Nuget
run: "nuget push Smartway.UiComponent.${{ inputs.app-version }}.nupkg -ApiKey ${{ secrets.NUGET_API_KEY }} -Source nuget.org -NonInteractive"
- name: Send Slack Notification
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": "GitHub Action build result: ${{ github.workflow }} : ${{ job.status }}\nPipeline: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ github.workflow }} : ${{ job.status }}\nPipeline: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK