-
Notifications
You must be signed in to change notification settings - Fork 2.1k
73 lines (61 loc) · 2.08 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
70
71
72
73
name: Release
on:
workflow_dispatch:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
update-environment: true
cache: 'pipenv'
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies with pipenv
run: pipenv --python 3.8 && pipenv install
- name: Install PyInstaller
run: pipenv install pyinstaller
- name: Build the application
run: pipenv run pyinstaller tkinter_ui.spec
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: update-tool
path: /home/runner/work/TV/TV/dist/update-tool
- name: Install jq
run: sudo apt-get install jq
- name: Get version from version.json
id: get_info
run: |
echo "version=$(node -p "require('./version.json').version")" >> $GITHUB_ENV
- name: Get changelog
id: get_changelog
run: |
changelog=$(sed -n '/## v'${{ env.version }}'/,/^## v/p' CHANGELOG.md | sed '/^## v'${{ env.version }}'/d' | sed -n '/###/,/^## v/p' | head -n -1)
echo "changelog=$(echo "$changelog" | jq -R -s .)" >> $GITHUB_ENV
- 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: /home/runner/work/TV/TV/dist/update-tool
asset_name: update-tool.exe
asset_content_type: application/octet-stream