-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (78 loc) · 2.67 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: build-and-deploy
on:
push:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
packages: write
pull-requests: write
concurrency:
group: "build"
cancel-in-progress: true
jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: 'oldstable'
- name: Setup Node.js environment
uses: actions/[email protected]
- name: Setup .NET environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
source-url: https://nuget.pkg.github.com/tuihub/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Setup Rust environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Dart environment
uses: dart-lang/[email protected]
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Install Protoc Plugins
run: make install-plugins
- name: Setup bufbuild
uses: bufbuild/[email protected]
- name: Build
run: make generate
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Apply Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: apply auto code generation'
- uses: google-github-actions/release-please-action@v4
id: release-please
with:
config-file: release-please-config.json
- name: Build C# project
if: ${{ steps.release-please.outputs.releases_created }}
run: dotnet build TuiHub.Protos.csproj -c Release
- name: Create nuget package
if: ${{ steps.release-please.outputs.releases_created }}
run: dotnet pack TuiHub.Protos.csproj --no-build -c Release
- name: Publish nuget package to GPR
if: ${{ steps.release-please.outputs.releases_created }}
run: dotnet nuget push bin/Release/*.nupkg --skip-duplicate
- name: Publish nuget package to nuget.org
if: ${{ steps.release-please.outputs.releases_created }}
run: dotnet nuget push bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}}