-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (85 loc) · 2.59 KB
/
cicd.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
91
92
93
94
95
96
97
name: CI/CD
on:
push:
branches:
- main
paths:
- 'src/**'
pull_request:
branches: [ main ]
paths:
- 'src/**'
workflow_dispatch:
env:
dotnet_versions: |
6.0.x
8.0.x
jobs:
ci-tchaxx-snappy-cli:
name: CI - TcHaxx.Snappy.CLI
runs-on: ubuntu-latest
env:
solution: ./TcHaxx.Snappy.CLI.sln
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.dotnet_versions}}
- name: Restore dependencies
run: dotnet restore ${{ env.solution }}
- name: Build
run: dotnet build -c Release --no-restore ${{ env.solution }}
- name: Test
if: success()
run: dotnet test -c Release --no-build --verbosity normal ${{ env.solution }}
ci-tchaxx-snappy-tc:
name: CI - TcHaxx.Snappy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build TcHaxx.Snappy
uses: Zeugwerk/zkbuild-action@1.0.0
with:
username: ${{ secrets.ACTIONS_ZGWK_USERNAME }}
password: ${{ secrets.ACTIONS_ZGWK_PASSWORD }}
- name: Upload *.library
uses: actions/upload-artifact@v4
with:
name: snappy
path: |
**/*.library
cd-tchaxx-snappy-cli:
needs: ci-tchaxx-snappy-cli
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
name: CD - TcHaxx.Snappy.CLI
runs-on: ubuntu-latest
permissions:
contents: write
env:
solution: ./TcHaxx.Snappy.CLI.sln
csproj: ./src/TcHaxx.Snappy.CLI/TcHaxx.Snappy.CLI.csproj
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet_versions }}
- uses: actions/download-artifact@v4
with:
name: snappy
path: .dist/
- name: Download latest rplc.library
run: curl -L https://github.com/tchaxx/rplc/releases/latest/download/rplc.library -o .dist/rplc.library
- name: Restore dependencies
run: dotnet restore ${{ env.solution }}
- name: Pack
env:
INCLUDE_TC_LIBRARIES: true
run: dotnet pack -c Release --no-restore ${{ env.solution }}
- name: Publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: ${{ env.csproj }}
NUGET_KEY: ${{ secrets.TCHAXX_NUGET_API_KEY }}