Release #16
Workflow file for this run
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: Release | |
env: | |
PROJECT_NAME: StarRailTools | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
defaults: | |
run: | |
shell: powershell | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python version | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- name: Install dependencies | |
run: poetry install --with release --without test,dev | |
- name: Package | |
run: | | |
poetry run pyinstaller --clean ./main_d.spec | |
poetry run pyinstaller --clean ./main_f.spec | |
- name: Generate package name | |
run: | | |
echo "file-name=${{ env.PROJECT_NAME }}_${{ github.ref_name }}" >> "$env:GITHUB_ENV" | |
- name: Archive folder | |
run: | | |
Compress-Archive -Path .\dist\${{ env.PROJECT_NAME }} -DestinationPath .\{{ env.file-name }}.zip | |
- name: Move and rename exe | |
run: | | |
Move-Item -Path .\dist\${{ env.PROJECT_NAME }}.exe -Destination .\${{ env.file-name }}.exe | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ env.PROJECT_NAME }} ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
files: | | |
${{ env.file-name }}.exe | |
${{ env.file-name }}.zip | |
fail_on_unmatched_files: true | |
- name: Upload to Coding.net | |
if: ${{ ! github.event.release.prerelease }} | |
run: | | |
npm install coding-generic -g | |
Copy-Item -Path ${{ env.file-name }}.exe -Destination ${{ env.PROJECT_NAME }}.exe | |
coding-generic -u="${{ secrets.CODING_ARTIFACTS_NAME }}:${{ secrets.CODING_ARTIFACTS_PASSWD }}" -p="${{ env.PROJECT_NAME }}.exe" -r="https://cntvc-generic.pkg.coding.net/star-rail-tools/releases/chunks/${{ env.PROJECT_NAME }}.exe?version=${{ github.ref_name }}" |