添加选择时的转发出站 #23
Workflow file for this run
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: CMake_Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Ninja_release | |
BUILD_TARGET: build_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 | |
# 创建权限 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
# - name: "Set environmental variables" | |
# shell: bash | |
# run: | | |
# echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | |
- uses: ilammy/msvc-dev-cmd@v1 | |
# - name: Install ninja-build tool | |
# uses: seanmiddleditch/gha-setup-ninja@v3 | |
- uses: lukka/get-cmake@latest | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@main | |
id: runvcpkg | |
with: | |
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch. | |
# The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule. | |
# The vcpkg.json file, which will be part of cache key computation. | |
vcpkgJsonGlob: '**/vcpkg.json' | |
# - name: Cache vcpkg | |
# id: cache-vcpkg | |
# uses: actions/cache@v3 | |
# with: | |
# path: | | |
# ${{ env.VCPKG_ROOT }} | |
# !${{ env.VCPKG_ROOT }}/.git | |
# !${{ env.VCPKG_ROOT }}/buildtrees | |
# !${{ env.VCPKG_ROOT }}/downloads | |
# ${{ github.workspace }}/build/vcpkg_installed | |
# key: ${{ runner.os }}-cache-key-v1-${{ hashFiles( 'vcpkg.json' ) }} | |
# restore-keys: ${{ runner.os }}-cache-key-v1- | |
- name: Prints output of run-vcpkg's action | |
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'" | |
- name: Run CMake+vcpkg+Ninja | |
uses: lukka/run-cmake@v10 | |
id: runcmake | |
with: | |
configurePreset: '${{env.BUILD_TYPE}}' | |
buildPreset: '${{env.BUILD_TARGET}}' | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: build/sing_box_config*.7z | |
# - name: Test | |
# working-directory: ${{github.workspace}}/build | |
# # Execute tests defined by the CMake configuration. | |
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
# run: ctest -C ${{env.BUILD_TYPE}} | |