-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (66 loc) · 2.43 KB
/
publish.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: publish
on: [push, pull_request]
env:
PLUGIN_NAME: "CS2Interface"
DOTNET_SDK_VERSION: 8.0
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Verify .NET Core
run: dotnet --info
- name: Prepare for publishing
run: dotnet restore
- name: Publish
run: |
dotnet publish ${{ env.PLUGIN_NAME }} -c "Release" -o "out/generic" -p:ContinuousIntegrationBuild=true --nologo
mkdir -p ./out/dist/${{ env.PLUGIN_NAME }}
cp ./out/generic/${{ env.PLUGIN_NAME }}.dll ./out/dist/${{ env.PLUGIN_NAME }}
( cd ./out/generic/ ; cp --parents ./*/${{ env.PLUGIN_NAME }}.resources.dll ../dist/${{ env.PLUGIN_NAME }} || : )
- name: Create README
uses: docker://pandoc/core:3.1
with:
args: --metadata title="${{ env.PLUGIN_NAME }}" --standalone --columns 2000 -f markdown -t html --embed-resources --standalone -c ./github-pandoc.css -o ./out/dist/${{ env.PLUGIN_NAME }}/README.html README.md
- name: Upload ${{ env.PLUGIN_NAME }}
uses: actions/[email protected]
with:
name: ${{ env.PLUGIN_NAME }}
path: out/dist
release:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Download ${{ env.PLUGIN_NAME }} artifact
uses: actions/[email protected]
with:
name: ${{ env.PLUGIN_NAME }}
path: out
- name: Create Zip
run: |
cd out
7z a -tzip -mx7 ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
- name: Create ${{ env.PLUGIN_NAME }} GitHub release
uses: ncipollo/[email protected]
with:
artifacts: out/${{ env.PLUGIN_NAME }}.zip
artifactContentType: application/zip
name: ${{ env.PLUGIN_NAME }} V${{ github.ref_name }}
tag: ${{ github.ref_name }}
bodyFile: .github/RELEASE_TEMPLATE.md
token: ${{ secrets.GITHUB_TOKEN }}
makeLatest: false
prerelease: true
draft: true