-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.17 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
name: Release
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
build_and_release:
runs-on: ubuntu-latest
env:
DOTNET_VERSION: '7.0.x'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout data
uses: actions/checkout@v3
with:
repository: anmalkov/crisp-data
token: ${{ secrets.CRISP_DATA_TOKEN }}
path: src/repos/brief
- name: Remove git folder
run: rm -rf src/repos/brief/.git
- name: test
run: ls -la src/repos/brief
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set version from tag
run: |
TAG_NAME=$(echo $GITHUB_REF | cut -d '/' -f 3)
VERSION=${TAG_NAME#v}
echo "TAG_VERSION=$VERSION" >> $GITHUB_ENV
echo "Updating project version to $VERSION"
sed -i "s/<AssemblyVersion>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<FileVersion>$VERSION<\/FileVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<AssemblyVersion>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Ui/Crisp.Ui.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<FileVersion>$VERSION<\/FileVersion>/g" Crisp.Ui/Crisp.Ui.csproj
working-directory: src
# - name: Restore dependencies
# run: dotnet restore
# working-directory: src/Crisp.Core
# - name: Build application
# run: dotnet build --configuration Release --no-restore
# working-directory: src/Crisp.Core
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: src
push: true
tags: |
anmalkov/crisp:${{ env.TAG_VERSION }}
anmalkov/crisp:latest