-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (50 loc) · 1.6 KB
/
CI.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
name: CI
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install PyInstaller
run: |
pip install pyinstaller
- name: Build executable
run: |
pyinstaller -F -n AGPicCompress --icon=assets/logo.ico --version-file assets/my.txt ImageCompressor.py
ren dist AGPicCompress
python -m zipfile -c ${{ github.workspace }}/AGPicCompress.zip ${{ github.workspace }}/AGPicCompress
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Extract Version
id: extract_version
run: |
echo "::set-output name=version::$(echo "${{ github.ref }}" | cut -d'/' -f3)"
shell: bash
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/AGPicCompress.zip
asset_name: AGPicCompress_windows_${{ steps.extract_version.outputs.version }}.zip
asset_content_type: application/zip