-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (43 loc) · 1.46 KB
/
release.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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
defaults:
run:
working-directory: ./Matomo.Maui
jobs:
build:
runs-on: windows-latest
env:
working-directory: ./Matomo.Maui
name: Build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Extract tag name
id: tag
uses: actions/github-script@0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return context.payload.ref.replace(/\/refs\/tags\//, '');
- name: Restore nuget packages for solution
run: nuget restore
- name: Pack
run: |
$version=${{ steps.tag.outputs.result }}
$version=$version.replace("refs/tags/v", "")
dotnet pack --configuration Release --verbosity detailed --output ../package -p:PackageVersion=$version
- name: Push
run: |
$version=${{ steps.tag.outputs.result }}
$version=$version.replace("refs/tags/v", "")
$package="../package/Matomo.Maui." + $version + ".nupkg"
dotnet nuget push $package -k "$env:NUGET_ORG_TOKEN" -s https://api.nuget.org/v3/index.json
env:
NUGET_ORG_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}