-
Notifications
You must be signed in to change notification settings - Fork 15
41 lines (41 loc) · 1.3 KB
/
publish.yml
File metadata and controls
41 lines (41 loc) · 1.3 KB
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
name: Publish
on:
push:
tags: ["*"]
jobs:
nuget-push:
runs-on: ubuntu-latest
environment: NuGet
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.x
- run: dotnet pack
- run: dotnet nuget push 'ScipDotnet/bin/Release/*.nupkg' --source 'nuget.org' --api-key '${{ secrets.NUGET_APIKEY }}' --skip-duplicate
docker-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.x
- uses: docker/setup-buildx-action@v2
- run: echo "PATCH=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- run: echo "MINOR=${PATCH%.*}" >> $GITHUB_ENV
- run: echo "MAJOR=${MINOR%.*}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: |
sourcegraph/scip-dotnet:latest
sourcegraph/scip-dotnet:${{ env.PATCH }}
sourcegraph/scip-dotnet:${{ env.MINOR }}
sourcegraph/scip-dotnet:${{ env.MAJOR }}