forked from Tencent/puerts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc78939
commit 7f8582f
Showing
2 changed files
with
126 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag_name: | ||
description: 'tag name' | ||
required: true | ||
|
||
jobs: | ||
android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install NDK | ||
run: | | ||
cd ~ | ||
wget -O NDK -q https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip | ||
sudo apt install unzip -y | ||
unzip -q NDK | ||
ANDROID_NDK_HOME=$(pwd)/android-ndk-r15c | ||
- name: Build | ||
run: | | ||
cd unity/native_src | ||
chmod 777 make_android.sh | ||
./make_android.sh | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./unity/Assets/Plugins/**/* | ||
name: Puerts_Unity_Plugins | ||
ios: | ||
runs-on: macos-10.15 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: | | ||
cd unity/native_src | ||
chmod 777 make_ios.sh | ||
./make_ios.sh | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./unity/Assets/Plugins/**/* | ||
name: Puerts_Unity_Plugins | ||
osx: | ||
runs-on: macos-10.15 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: | | ||
cd unity/native_src | ||
chmod 777 make_osx.sh | ||
./make_osx.sh | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./unity/Assets/Plugins/**/* | ||
name: Puerts_Unity_Plugins | ||
windows: | ||
runs-on: windows-2016 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Insatll MSVC | ||
uses: microsoft/[email protected] | ||
|
||
- name: Build | ||
run: | | ||
cd unity\native_src | ||
mkdir build64 | ||
cd build64 | ||
cmake -G "Visual Studio 15 2017 Win64" .. | ||
cd .. | ||
cmake --build build64 --config Release | ||
mkdir -p ..\Assets\Plugins\x86_64\ | ||
copy .\build64\Release\puerts.dll ..\Assets\Plugins\x86_64\puerts.dll | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./unity/Assets/Plugins/**/* | ||
name: Puerts_Unity_Plugins | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [windows,osx,ios,android] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Retrieve version | ||
run: | | ||
echo "PLUGIN_VERSION=$(cat unity/native_src/Src/Puerts.cpp | grep -Po '(?<=LIB_VERSION\s)(\d+)')" >> $GITHUB_ENV | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: Puerts_Unity_Plugins | ||
path: Plugins/ | ||
|
||
- name: Create Release Asset | ||
run: | | ||
tar cvfz Plugins_v${{ env.PLUGIN_VERSION }}.tgz Plugins | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.event.inputs.tag_name }} | ||
release_name: Tag:${{ github.event.inputs.tag_name }},Plugin_Version:${{ env.PLUGIN_VERSION }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./Plugins_v${{ env.PLUGIN_VERSION }}.tgz | ||
asset_name: Plugins_v${{ env.PLUGIN_VERSION }}.tgz | ||
asset_content_type: application/tgz | ||
|