Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
test action
Browse files Browse the repository at this point in the history
  • Loading branch information
twoone3 committed Aug 7, 2021
1 parent 025a85c commit 5d5ba00
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 53 deletions.
62 changes: 12 additions & 50 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: MSBuild

on: [push]
on:
push:
tags:
- 'v*' # such as v1.6.2

env:
SOLUTION_FILE_PATH: .
Expand All @@ -12,7 +14,8 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
Expand All @@ -23,52 +26,11 @@ jobs:

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild ./BDSpyrunner.sln -property:Configuration=Release
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: MkDirs
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
mkdir D:/out
- name: Copy Out Files
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cp -a D:/a/BDSpyrunner/test/bdxcore_mod/*.dll D:/out
cp -a D:/a/BDSpyrunner/test/bdxcore_mod/*.pdb D:/out
shell: bash

- name: package
if: startsWith(github.event.ref, 'refs/tags/v')
shell: pwsh
run: Compress-Archive -Path D:/out/* out.zip

- name: Create Release
if: startsWith(github.event.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PYR_PUBLISH }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ""
draft: false
prerelease: false

- name: Upload Release Asset
if: startsWith(github.event.ref, 'refs/tags/v')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PYR_PUBLISH }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./out.zip
asset_name: BDSpyrunner.zip
asset_content_type: application/zip

- name: Upload artifact
uses: actions/[email protected]
- name: GH Release
uses: softprops/[email protected]
with:
name: BDSpyrunner
path: D:/out
files: |
./out/BDSpyrunner.dll
./out/BDSpyrunner.pdb
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.vs
BDSpyrunner/Release
/BDSpyrunner/dyncall
out
4 changes: 2 additions & 2 deletions BDSpyrunner/BDSpyrunner.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\test\bdxcore_mod\</OutDir>
<OutDir>../out/</OutDir>
<IntDir>$(Configuration)\</IntDir>
<PublicIncludeDirectories>
</PublicIncludeDirectories>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\test\bdxcore_mod\</OutDir>
<OutDir>../out/</OutDir>
<IntDir>$(Configuration)\</IntDir>
<PublicIncludeDirectories>
</PublicIncludeDirectories>
Expand Down
7 changes: 7 additions & 0 deletions BDSpyrunner/mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
#define MODULE_NAME "mc"
#define Py_RETURN_ERROR(str) return PyErr_SetString(PyExc_Exception, str), nullptr

constexpr size_t Hash(const char* s) {
unsigned h = 0;
for (; *s; ++s)
h = 5 * h + *s;
return size_t(h);
}

#pragma region EventCode
enum class EventCode {
None,
Expand Down

0 comments on commit 5d5ba00

Please sign in to comment.