修改原先的一些翻译 #31
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
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. | |
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml | |
name: CMake Build GitHubDesktop2Chinese | |
on: | |
push: | |
tags: | |
- '*' | |
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@v4 | |
- name: utf8 | |
# 使用utf8编码环境编译 | |
run: chcp 65001 | |
- name: Get tag | |
id: tag | |
uses: devops-actions/[email protected] | |
with: | |
default: v0.0.0 # Optional: Default version when tag not found | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: chcp 65001 && cmake -B ${{github.workspace}}/build -DGitHubActions=1 -DFILE_VERSION="${{steps.tag.outputs.tag}}" | |
- name: Build | |
# Build your program with the given configuration | |
run: chcp 65001 && cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Upload Release GitHubDesktop2Chinese.exe | |
uses: actions/upload-artifact@v4 | |
with: | |
name: GitHubDesktop2Chinese | |
path: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/GitHubDesktop2Chinese.exe | |
publish_release: | |
name: Publish release | |
needs: build | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{github.workspace}}/build/ | |
- name: Get tag | |
id: tag | |
uses: devops-actions/[email protected] | |
with: | |
default: v0.0.0 # Optional: Default version when tag not found | |
- name: Create release | |
#if: github.event.inputs.status != 'stable' | |
uses: ncipollo/release-action@v1 | |
with: | |
prerelease: false # 是否是预览版 | |
tag: ${{steps.tag.outputs.tag}} | |
bodyFile: "ReleaseBody.md" | |
#name: 0 | |
artifacts: ${{github.workspace}}/build/GitHubDesktop2Chinese/GitHubDesktop2Chinese.exe,${{github.workspace}}/json/localization.json | |
env: | |
GITHUB_REPOSITORY: CNGEGE/GitHubDesktop2Chinese | |