-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.21 KB
/
release.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
name: Build and Release
on:
push:
branches:
- main
- beta
- alpha
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
issues: write
contents: write
pull-requests: write
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: npm ci
- name: Release
id: release-next-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: (NuGet) Pack Core Library
run: dotnet pack GLOKON.Baiters.Core/GLOKON.Baiters.Core.csproj --configuration Release --output nupkgs
- name: (NuGet) Publish Core Library
run: dotnet nuget push "nupkgs/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Show Version
run: echo "Next version is ${{ steps.release-next-version.outputs.new-release-version }} (${{ github.ref_name }})"
outputs:
published: ${{ steps.release-next-version.outputs.new-release-published }}
version: ${{ steps.release-next-version.outputs.new-release-version }}
tag: ${{ steps.release-next-version.outputs.new-release-git-tag }}
build-server:
name: Build Server
uses: ./.github/workflows/build-server.yml
needs:
- build_and_release
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: windows-latest
rid: win-x64
with:
branch: ${{ github.ref_name }}
operatingSystem: ${{ matrix.os }}
buildRuntime: ${{ matrix.rid }}
publish: ${{ contains(fromJSON('["main", "beta", "alpha"]'), github.ref_name) }}
tag: ${{ needs.build_and_release.outputs.tag }}
version: ${{ needs.build_and_release.outputs.version }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}