[WIP] Reconfiguration...80%?[no ic] #158
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
name: Auto Release Action | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
env: | |
Version: Init | |
Release: Init | |
isPreRelease: true | |
ChangeLog: Init | |
CommitMessage: Init | |
NotSkip: true | |
jobs: | |
AutoRelease: | |
name: Auto Release | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Version & Set GITHUB_ENV | |
run: | | |
$vc = "${{ github.event.head_commit.message }}" -split " " | |
echo "$vc" | |
echo "Version=$($vc[0])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "CommitMessage=$($vc[1])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
if ( $vc[2] -eq 'Release' ){ | |
$release = $vc[0] -replace "rc"," Release " | |
echo 'isPreRelease=false' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo (Get-Content ./changelog.md) | |
}elseif( $vc[2] -eq 'NotRelease' ){ | |
$release = $vc[0] -replace "pre"," NotRelease " | |
# echo "NotSkip=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
}else{ | |
$release = $vc[0] -replace "pre"," PreRelease " | |
echo (Get-Content ./changelog.md) | |
} | |
echo "Release=$release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo $release | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11.5' | |
- name: Cache Python Environment | |
uses: actions/cache@v2 | |
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: Python Pip Install | |
# uses: logikal-code/[email protected] | |
- name: Install requirements | |
run: | | |
pip3 install -r requirements.txt | |
# - name: Clean up PATH | |
# uses: egor-tensin/cleanup-path@v3 | |
# - name: Set up MinGW | |
# id: setup | |
# uses: egor-tensin/setup-mingw@v2 | |
# with: | |
# version: '12.2.0' | |
# - name: Build SavDecode.dll | |
# run: | | |
# & '${{ steps.setup.outputs.gxx }}' --version | |
- name: Dist ${{ env.Version }} | |
# if: ${{ env.NotSkip == 'true'}} | |
run: | | |
pyinstaller build.spec --distpath ./NoCLI/ --clean | |
Compress-Archive -LiteralPath ./NoCLI/MusyncSaveDecode/ -DestinationPath ("./MusyncSavDecodeGUI_NoConsole_${{ env.Version }}.zip") | |
Rename-Item -Path ./MusyncSaveDecode.exe -NewName ("MusyncSavDecodeGUI_NoConsole_${{ env.Version }}_AllInOne.exe") | |
Compress-Archive -LiteralPath ./WithCLI/MusyncSaveDecode/ -DestinationPath ("./MusyncSavDecodeGUI_WithConsole_${{ env.Version }}.zip") | |
Rename-Item -Path ./MusyncSaveDecode.exe -NewName ("MusyncSavDecodeGUI_WithConsole_${{ env.Version }}_AllInOne.exe") | |
- name: Commit Release | |
# if: ${{ env.NotSkip == 'true'}} | |
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: | | |
./MusyncSavDecodeGUI_NoConsole_${{ env.Version }}.zip | |
./MusyncSavDecodeGUI_NoConsole_${{ env.Version }}_AllInOne.exe | |
./MusyncSavDecodeGUI_WithConsole_${{ env.Version }}.zip | |
./MusyncSavDecodeGUI_WithConsole_${{ env.Version }}_AllInOne.exe |