Update issue templates #145
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.txt) | |
}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.txt) | |
} | |
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 NoConsole ${{ env.Version }} Compress Version | |
# if: ${{ env.NotSkip == 'true'}} | |
run: | | |
pyinstaller --distpath ./NoCLI/ -D -i ./musync_data/Musync.ico ./MusyncSavDecodeGUI.py -w --clean | |
Compress-Archive -LiteralPath ./NoCLI/MusyncSavDecodeGUI/ -DestinationPath ("./MusyncSavDecodeGUI_NoConsole_${{ env.Version }}.zip") | |
- name: Dist NoConsole ${{ env.Version }} AllInOne Version | |
# if: ${{ env.NotSkip == 'true'}} | |
run: | | |
pyinstaller --distpath ./ -F -i ./musync_data/Musync.ico ./MusyncSavDecodeGUI.py -w | |
Rename-Item -Path ./MusyncSavDecodeGUI.exe -NewName ("MusyncSavDecodeGUI_NoConsole_${{ env.Version }}_AllInOne.exe") | |
- name: Dist WithConsole ${{ env.Version }} Compress Version | |
# if: ${{ env.NotSkip == 'true'}} | |
run: | | |
pyinstaller --distpath ./WithCLI/ -D -i ./musync_data/Musync.ico ./MusyncSavDecodeGUI.py | |
Compress-Archive -LiteralPath ./WithCLI/MusyncSavDecodeGUI/ -DestinationPath ("./MusyncSavDecodeGUI_WithConsole_${{ env.Version }}.zip") | |
- name: Dist WithConsole ${{ env.Version }} AllInOne Version | |
# if: ${{ env.NotSkip == 'true'}} | |
run: | | |
pyinstaller --distpath ./ -F -i ./musync_data/Musync.ico ./MusyncSavDecodeGUI.py | |
Rename-Item -Path ./MusyncSavDecodeGUI.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.txt | |
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 |