-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (79 loc) · 2.89 KB
/
build.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
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
# Required by release-please
permissions:
contents: write
pull-requests: write
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET (v8.0)
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
- name: Test
run: |
dotnet test --configuration Debug
dotnet test --configuration Release
- name: Publish
run: dotnet publish src/Noted -o src/Noted/bin/Publish/ --configuration Release
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Noted.${{ matrix.os }}
path: src/Noted/bin/Publish/
- name: Release please
uses: googleapis/release-please-action@v4
id: release
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
publish:
if: contains(github.ref, 'tags/v') # only publish tagged versions
needs: [test]
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
HUSKY: 0
steps:
- uses: actions/checkout@v3
- name: Install .NET (v8.0)
uses: actions/[email protected]
with:
dotnet-version: 8.x
- name: Build
run: |
dotnet publish src/Noted -c Release --self-contained false -r win-x64 -o ./src/Noted/bin/Portable.win-x64
dotnet publish src/Noted -c Release --self-contained false -r linux-x64 -o ./src/Noted/bin/Portable.linux-x64
dotnet publish src/Noted -c Release --self-contained -r win-x64 -o ./src/Noted/bin/win-x64
dotnet publish src/Noted -c Release --self-contained -r linux-x64 -o ./src/Noted/bin/linux-x64
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.Portable.win-x64.zip ./src/Noted/bin/Portable.win-x64 -r
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.Portable.linux-x64.zip ./src/Noted/bin/Portable.linux-x64 -r
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.win-x64.zip ./src/Noted/bin/win-x64 -r
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.linux-x64.zip ./src/Noted/bin/linux-x64 -r
ls -l src/Noted/bin
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' src/Noted/bin/*.zip
--repo '${{ github.repository }}'