Skip to content

2.0.0rc1 完成初步测试 Release #163

2.0.0rc1 完成初步测试 Release

2.0.0rc1 完成初步测试 Release #163

Workflow file for this run

name: Auto Release Action
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
isPreRelease: true
Version: Init
CommitMessage: Init
jobs:
AutoRelease:
name: Auto Release
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Python Environment
uses: actions/cache@v4
env:
cache-name: cache-python-environment
with:
path: c:\hostedtoolcache\windows\python
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.5'
- name: Install requirements
run: |
pip3 install -r ./requirements.txt
- name: Fix Environment
run: |
$isPreRelease = python -c "import Version;print(Version.isPreRelease)";
$isPreReleaseBool = [bool]::Parse($isPreRelease);
if ($isPreReleaseBool) { # 根据布尔值调用不同的属性并赋值给 $version
$version = py -c "import Version; print(Version.preVersion)";
} else {
$version = py -c "import Version; print(Version.version)";
}
echo "isPreRelease=${isPreReleaseBool}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Version=${version}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Dist ${{ env.Version }}
run: |
$vc = "${{ github.event.head_commit.message }}" -split " "
echo "$vc"
echo "CommitMessage=$($vc[1])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
powershell.exe ./buildLauncher.ps1
- name: Commit Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
name: ${{ env.Release }} ${{ env.CommitMessage }} < Auto Release >
tag_name: ${{ env.Version }}
draft: false
body_path: ${{ github.workspace }}/changelog.md
prerelease: ${{ env.isPreRelease }}
files: ./MusyncSaveDecode/Archive/*