tencentyun/iot-p2p@a7ff37d6 #392
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
name: Windows XP2P CI | |
on: | |
push: | |
paths-ignore: # 有時候不想要改個文档也触发 github actions | |
- '**.md' | |
- 'LICENSE' | |
jobs: | |
build-and-deploy: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.16.0' | |
- name: Use cmake | |
run: echo +++++$(cmake --version) | |
# - name: RC.exe | |
# run: | | |
# function Invoke-VSDevEnvironment { | |
# $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" | |
# $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath | |
# $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat" | |
# & "${env:COMSPEC}" /s /c "`"$Command`" -no_logo && set" | Foreach-Object { | |
# if ($_ -match '^([^=]+)=(.*)') { | |
# [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2]) | |
# } | |
# } | |
# } | |
# Invoke-VSDevEnvironment | |
# Get-Command rc.exe | Format-Table -AutoSize | |
- name: debug build libenet | |
if: startsWith(github.event.ref, 'refs/heads') | |
run: | | |
$branch="${{ github.ref }}" | |
$branch=$branch.Split("/")[2] | |
echo $branch | |
.\.github\script\build_enet_windows.cmd Debug $branch | |
shell: pwsh | |
env: | |
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }} | |
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
- name: release build libenet | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
$branch="${{ github.ref }}" | |
$branch=$branch.Split("/")[2] | |
echo $branch | |
.\.github\script\build_enet_windows.cmd Release $branch | |
shell: pwsh | |
env: | |
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }} | |
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
- name: Compress SDK Artifacts | |
run: | | |
tar.exe -a -c -f xp2p_windows.zip iot-p2p/iot/link/pc_app/p2p_sample | |
- name: Upload Windows SDK Library | |
if: startsWith(github.event.ref, 'refs/heads') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xp2p_windows_lib | |
path: xp2p_windows.zip | |
- name: Upload binaries to release | |
if: startsWith(github.event.ref, 'refs/tags') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: xp2p_windows.zip | |
asset_name: xp2p_windows.zip | |
tag: ${{ github.ref }} | |
overwrite: true |