-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (78 loc) · 2.39 KB
/
Copy pathbuild.yml
File metadata and controls
91 lines (78 loc) · 2.39 KB
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
name: StreamViewer
on:
push:
branches:
- main
- dev
pull_request:
types: [ opened, ready_for_review, reopened, synchronize ]
release:
types: [ published ]
workflow_dispatch:
env:
DOTNET_VERSION: 8.0.x
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Build-${{ matrix.os }}
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: List installed .NET SDKs
run: dotnet --list-sdks
- name: Restore dependencies
run: dotnet restore
- name: Build StreamViewer
run: dotnet build --configuration Release
- name: Publish
if: github.event_name == 'release'
run: dotnet publish ./StreamViewer/StreamViewer.csproj --configuration Release --output ./publish
- name: Upload artifacts
if: github.event_name == 'release'
uses: actions/upload-artifact@v7
with:
name: StreamViewer-${{ runner.os }}
path: ./publish
publish:
name: Publish
permissions:
contents: write
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
- name: Print release version
run: echo ${{ github.ref_name }}
- name: Create archive
run: |
7z a StreamViewer-macOS-v${{ github.ref_name }}.zip ./StreamViewer-macOS/*
7z a StreamViewer-Linux-v${{ github.ref_name }}.zip ./StreamViewer-Linux/*
7z a StreamViewer-Windows-v${{ github.ref_name }}.zip ./StreamViewer-Windows/*
- name: Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
files: |
StreamViewer*.zip