Skip to content

Workflow file for this run

on:
release:
types:
- published
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: "2.9.3"
- uses: actions/cache@v4
with:
path: |
~/AppData/Local/.xmake
key: xmake-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-
- uses: microsoft/setup-msbuild@v2
- run: |
xmake repo -u
- run: |
xmake f -a x64 -m release -p windows -y
- run: |
xmake -w -y
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }}
path: |
bin/
update-release-notes:
outputs:
release_notes: ${{ steps.extract-release-notes.outputs.release_notes }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- uses: softprops/action-gh-release@v1
with:
body: |
${{ steps.extract-release-notes.outputs.release_notes }}
upload-to-release:
needs:
- build
- update-release-notes
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }}
path: artifact
- run: |
cp CHANGELOG.md README.md artifact/
- run: |
zip -r ../${{ github.event.repository.name }}-windows-x64.zip *
working-directory: artifact
- uses: softprops/action-gh-release@v1
with:
files: |
${{ github.event.repository.name }}-windows-x64.zip
upload-to-minebbs:
needs:
- build
- update-release-notes
runs-on: ubuntu-latest
steps:
# 检出代码
- uses: actions/checkout@v4
# 下载构建产物
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }}
path: artifact
# 复制文件
- run: |
cp CHANGELOG.md README.md artifact/
# 重新打包
- run: |
zip -r ../${{ github.event.repository.name }}-windows-x64.zip *
working-directory: artifact
- name: Upload to MineBBS
uses: engsr6982/upload-minebbs@v2
with:
minebbs_token: ${{ secrets.MINEBBS_TOKEN }}
resource_id: "5755" #! 务必确保资源ID正确
upload_file: ${{ github.event.repository.name }}-windows-x64.zip
update_description: ${{ needs.update-release-notes.outputs.release_notes }} # 使用 update-release-notes 步骤的输出