Skip to content

Commit b97c277

Browse files
committed
Setup automated docker releases
1 parent 435ffbf commit b97c277

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,30 @@ jobs:
1313
dotnet-version: 7.0.x
1414
- run: dotnet pack
1515
- run: dotnet nuget push 'ScipDotnet/bin/Debug/*.nupkg' --source 'nuget.org' --api-key '${{ secrets.NUGET_APIKEY }}' --skip-duplicate
16-
16+
docker-push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: 7.0.x
23+
- uses: docker/setup-buildx-action@v2
24+
- run: echo "PATCH=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
25+
- run: echo "MINOR=${PATCH%.*}" >> $GITHUB_ENV
26+
- run: echo "MAJOR=${MINOR%.*}" >> $GITHUB_ENV
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_PASSWORD }}
32+
- name: Build and push
33+
id: docker_build
34+
uses: docker/build-push-action@v3
35+
with:
36+
push: true
37+
tags: |
38+
sourcegraph/scip-dotnet:latest
39+
sourcegraph/scip-dotnet:${{ env.PATCH }}
40+
sourcegraph/scip-dotnet:${{ env.MINOR }}
41+
sourcegraph/scip-dotnet:${{ env.MAJOR }}
1742

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
2+
WORKDIR /scip-dotnet
3+
ADD . /scip-dotnet
4+
RUN dotnet pack
5+
ENV PATH="/root/.dotnet/tools:${PATH}"
6+
RUN dotnet tool install --add-source ScipDotnet/bin/Debug/ --global scip-dotnet

ScipDotnet.Tests/SnapshotTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
using System;
2+
using System.Collections.Generic;
13
using System.Diagnostics;
4+
using System.IO;
5+
using System.Linq;
26
using System.Text;
37
using DiffPlex.DiffBuilder;
48
using DiffPlex.DiffBuilder.Model;

0 commit comments

Comments
 (0)