Magpie/.github/workflows/release.yml
Xu 6fc3594d9d
支持 Visual Studio 2026 (#1343)
* chore: 支持 VS2026

* docs: 更新文档以及排除 pdb

* chore: 修复 pdb 生成

* chore: 禁止 Magpie.Core 生成 pdb

* chore: 清理
2025-11-27 21:57:38 +08:00

77 lines
2.2 KiB
YAML

name: Publish release
on:
workflow_dispatch:
inputs:
major:
description: 'Major'
required: true
type: number
minor:
description: 'Minor'
required: true
type: number
patch:
description: 'Patch'
required: true
type: number
tag:
description: 'Tag'
required: false
type: string
prerelease:
description: 'Prerelease'
required: true
type: boolean
jobs:
build:
runs-on: windows-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
strategy:
matrix:
platform: ["x64", "ARM64"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Setup Conan
run: pip install conan
- name: Generate tag
id: tag
run: |
$tag = "${{ inputs.tag }}" -eq "" ? "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" : "${{ inputs.tag }}"
echo "tag=$tag" >> $env:GITHUB_OUTPUT
- name: Build
run: python scripts/publish.py --compiler=ClangCL --platform=${{ matrix.platform }} --version-major=${{ inputs.major }} --version-minor=${{ inputs.minor }} --version-patch=${{ inputs.patch }} --version-tag=${{ steps.tag.outputs.tag }} --pfx-path=certs\Magpie.pfx --pfx-password="${{ secrets.MAGPIE_PFX_PASSWORD }}"
- name: Store artifacts
uses: actions/upload-artifact@v5
with:
name: Magpie-${{ steps.tag.outputs.tag }}-${{ matrix.platform }}
path: publish/${{ matrix.platform }}
release:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Setup Requests
run: pip install requests
- name: Restore artifacts
uses: actions/download-artifact@v6
with:
path: publish
- name: Publish release
run: python scripts/release.py ${{ inputs.major }} ${{ inputs.minor }} ${{ inputs.patch }} ${{ needs.build.outputs.tag }} ${{ inputs.prerelease }} ${{ secrets.CONTENTS_ACCESS_TOKEN }}