Skip to content

修复 BlueArchive 错误位置 v1.0.0.5 #68

修复 BlueArchive 错误位置 v1.0.0.5

修复 BlueArchive 错误位置 v1.0.0.5 #68

Workflow file for this run

name: Building
on: [push, pull_request]
jobs:
Build:
runs-on: ubuntu-latest
name: Building Source
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Up Load Artifact
uses: actions/upload-artifact@v4
with:
name: OIAPI
path: src/*
- name: Extract version from commit message
id: extract_version
shell: pwsh
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
$pattern = 'v\d+(\.\d+)*'
$commit_msg = "${{ github.event.head_commit.message }}"
$jsonContent = Get-Content -Path '.config/version.json' -Raw | ConvertFrom-Json
if ($commit_msg -match $pattern) {
$ver = $Matches[0] -replace 'v', ''
if($ver -ne $jsonContent.version){
$jsonContent.version = $ver
$newJsonContent = $jsonContent | ConvertTo-Json
Set-Content -Path '.config/version.json' -Value $newJsonContent
git add .config/version.json
git commit -m "自动更新版本文件 [skip ci]"
git push
}
}
else{
$ver = $jsonContent.version
}
echo "CURRENT_VER=$ver" >> $env:GITHUB_ENV
echo $ver
- name: Download File
uses: dawidd6/action-download-artifact@v6
with:
name: OIAPI
path: out
skip_unpack: true
- name: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: "V${{ env.CURRENT_VER }}"
name: OIAPI V${{ env.CURRENT_VER }}
body: |
# 更新内容
artifacts: out/OIAPI.zip
allowUpdates: true
removeArtifacts: true