-
-
Notifications
You must be signed in to change notification settings - Fork 20
85 lines (73 loc) · 2.82 KB
/
cmake-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
name: CMake
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure cmake
shell: bash
#github.workspace =trapdoor/trapdoor
working-directory: ${{github.workspace}}
run: cmake .
- name: Build
shell: bash
working-directory: ${{github.workspace}}
run: cmake --build . --config Release
- name: MkDir
shell: bash
working-directory: ${{github.workspace}}
run: |
mkdir D:/out
mkdir -p D:/out/plugins/trapdoor
- name: Copy Output Files
shell: bash
working-directory: ${{github.workspace}}
run: |
cp -r ./tools/package/lang D:/out/plugins/trapdoor
cp ./LICENSE D:/out
cp ./changelog.md D:/out
cp ./README.md D:/out
cp ./README_zh.md D:/out
cp ./Release/*.dll D:/out
cp ./tools/package/trapdoor-config.json D:/out/plugins/trapdoor
cp ./trapdoor-disclaimer.md D:/out
- name: package
if: startsWith(github.event.ref, 'refs/tags/')
shell: pwsh
run: Compress-Archive -Path D:/out/* out.zip
- name: Create Release
if: startsWith(github.event.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TRAPDOOR_PUBLISH }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: "见更新日志\nsee changelog"
draft: false
prerelease: false
- name: Upload Release Asset
if: startsWith(github.event.ref, 'refs/tags/')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TRAPDOOR_PUBLISH }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./out.zip
asset_name: TrapDoor.zip
asset_content_type: application/zip
- name: Upload Actions File
uses: actions/[email protected]
with:
name: TrapDoor
path: D:/out