forked from Guovin/iptv-api
-
Notifications
You must be signed in to change notification settings - Fork 20
86 lines (73 loc) · 2.61 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (73 loc) · 2.61 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
workflow_dispatch:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
update-environment: true
cache: 'pipenv'
- name: Install pipenv
run: pip3 install --user pipenv
- name: Install dependencies with pipenv
run: pipenv --python 3.13 && pipenv install --dev
- name: Build the application
run: pipenv run pyinstaller tkinter_ui/tkinter_ui.spec
- name: List dist directory contents
run: dir dist
- name: Get info from version.json
id: get_info
run: |
$json = Get-Content version.json | ConvertFrom-Json
echo "version=$($json.version)" >> $env:GITHUB_ENV
echo "name=$($json.name)" >> $env:GITHUB_ENV
shell: pwsh
- name: Compress dist directory
run: |
Compress-Archive -Path dist\* -DestinationPath dist\${{ env.name }}-v${{ env.version }}.zip
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.name }}-v${{ env.version }}
path: dist\${{ env.name }}-v${{ env.version }}.zip
- name: Install jq
run: choco install jq
- name: Get changelog
id: get_changelog
run: |
$version = "${{ env.version }}"
$changelog = (Get-Content CHANGELOG.md -Raw)
$changelog = [regex]::Match($changelog, "(?s)## v$version.*?(?=## v)").Value
$changelog = $changelog -replace "(?s)^## v$version.*?\n", ""
$changelog = $changelog.Trim()
$changelog | jq -Rs '.' | ForEach-Object { echo "changelog=$_"; echo "changelog=$_" >> $env:GITHUB_ENV }
shell: pwsh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: v${{ env.version }}
body: ${{ fromJSON(env.changelog) }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}-v${{ env.version }}.zip
asset_name: ${{ env.name }}-v${{ env.version }}.zip
asset_content_type: application/zip