-
Notifications
You must be signed in to change notification settings - Fork 4
124 lines (98 loc) · 3.48 KB
/
CI.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
# test:
# if: ${{ github.event_name != 'workflow_dispatch' }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 7.0.x
# - name: Run device simulator
# run: docker run --rm --name device-simulator -d -p 4403:4403 meshtastic/device-simulator
# - name: Run tests
# run: dotnet test --collect:"XPlat Code Coverage" --settings ./Meshtastic.Test/coverlet.runsettings
# - name: Move files up
# run: mv ./Meshtastic.Test/TestResults/**/coverage.info ./Meshtastic.Test/TestResults
# # For diagnostics
# - name: Show test results
# run: ls -lR
# - name: Upload coverage to Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./Meshtastic.Test/TestResults/coverage.info
release:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Cache python libs
uses: actions/cache@v3
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Upgrade python tools
shell: bash
run: |
python -m pip install --upgrade pip
- name: Get release version string
run: echo "version=$(./scripts/buildinfo.py short)" >> $GITHUB_OUTPUT
id: version
- name: Restore dependencies
run: dotnet restore
- name: Build solution and generate NuGet package
run: |
dotnet build ./Tak.Client/Tak.Client.csproj -c Release -p:AssemblyVersion=${{ steps.version.outputs.version }} -p:Version=${{ steps.version.outputs.version }}
dotnet pack ./Tak.Client/Tak.Client.csproj -c Release -p:AssemblyVersion=${{ steps.version.outputs.version }} -p:Version=${{ steps.version.outputs.version }}
- name: Publish package to nuget
run: dotnet nuget push ./**/Tak.Client.*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}} --source "https://nuget.pkg.github.com/thebentern/index.json"
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: Tak.Client ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
body: |
Autogenerated by github action, developer should edit as required before publishing...
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Bump version.properties
run: >-
scripts/bump_version.py
- name: Create version.properties pull request
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
version.properties