-
Notifications
You must be signed in to change notification settings - Fork 681
90 lines (78 loc) · 2.18 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
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
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version'
required: true
default: '1.0.0-preview1'
packageSource:
description: 'Package source'
required: true
default: 'https://api.nuget.org/v3/index.json'
env:
Version: ${{ github.event.inputs.releaseVersion }}
PackageVersion: ${{ github.event.inputs.releaseVersion }}
jobs:
verify:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Test
run: dotnet test --verbosity normal
release_zip:
needs: verify
name: Release BaGet.zip to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Publish
run: dotnet publish src/BaGet --configuration Release --output artifacts
- name: Upload
uses: actions/upload-artifact@v2
with:
name: BaGet
path: artifacts
release_packages:
needs: verify
name: Release packages to nuget.org
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Pack
run: dotnet pack --configuration Release --output artifacts
- name: Push
run: dotnet nuget push "*" -s ${{ github.event.inputs.packageSource }} -k ${{secrets.NUGET_API_KEY}}
working-directory: artifacts
release_docker_image:
needs: verify
name: Release Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
loicsharma/baget:latest
loicsharma/baget:${{ github.event.inputs.releaseVersion }}