-
Notifications
You must be signed in to change notification settings - Fork 13
46 lines (43 loc) · 1.47 KB
/
main.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
name: CI
on:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
version:
description: 'Release version to create'
required: true
jobs:
build_and_test:
runs-on: windows-latest
name: Build
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Build (CI)
if: ${{ github.event.inputs.version == '' }}
run: |
cd sizoscope
dotnet pack sizoscope.csproj -o .\nupkg
- name: Build (CD)
if: ${{ github.event.inputs.version != '' }}
run: |
cd sizoscope
dotnet pack sizoscope.csproj -o .\nupkg -p:Version=${{ github.event.inputs.version }}
- name: Archive NuGet (CI)
if: ${{ github.event.inputs.version == '' }}
uses: actions/upload-artifact@v2
with:
name: sizoscope.${{ github.event.inputs.version }}.nupkg
path: sizoscope/nupkg/sizoscope.42.42.42.42.nupkg
- name: Archive NuGet (CD)
if: ${{ github.event.inputs.version != '' }}
uses: actions/upload-artifact@v2
with:
name: sizoscope.${{ github.event.inputs.version }}.nupkg
path: sizoscope/nupkg/sizoscope.${{ github.event.inputs.version }}.nupkg
- name: Create tag
if: ${{ github.event.inputs.version != '' && github.actor == 'MichalStrehovsky' }}
run: |
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }}