-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (55 loc) · 1.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 }}"