-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.85 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
name: Release Preview Nuget Package
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-pre[0-9][0-9][0-9]"
defaults:
run:
working-directory: ./XamExtensionsSvg
jobs:
build:
runs-on: windows-latest
env:
working-directory: ./XamExtensionsSvg
name: Build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Extract tag name
id: tag
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return context.payload.ref.replace(/\/refs\/tags\//, '');
- name: Setup nuget
uses: nuget/setup-nuget@v1
- name: Restore nuget packages for solution
run: nuget restore ../XamExtensionsSvg.sln
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Build
run: msbuild XamExtensionsSvg.csproj /property:Configuration=Release
- name: Pack
run: |
$version=${{ steps.tag.outputs.result }}
$version=$version.replace("refs/tags/v", "")
nuget pack XamExtensionsSvg.nuspec -Prop Configuration=Release -verbosity detailed -basepath ./ -OutputDirectory ./package -Version $version
- name: Setup Nuget Push
run: nuget setApiKey "$env:NUGET_ORG_TOKEN"
env:
NUGET_ORG_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}
- name: Push
run: |
$version=${{ steps.tag.outputs.result }}
$version=$version.replace("refs/tags/v", "")
$package="package/Xamarin.Forms.Extensions.Svg." + $version + ".nupkg"
nuget push $package -Source https://api.nuget.org/v3/index.json