forked from ImSwitch/ImSwitch
-
Notifications
You must be signed in to change notification settings - Fork 15
76 lines (69 loc) · 2.19 KB
/
imswitch-bundle.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
74
75
name: imswitch-bundle
on:
workflow_dispatch:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
python3 -m pip install pyinstaller==5.4.1
shell: bash
- name: Find latest tag of dependency
id: remote_chart
uses: oprypin/find-latest-tag@v1
with:
repository: openUC2/UC2-REST
releases-only: true
- name: bump version
uses: mad9000/actions-find-and-replace-string@2
with:
source: ${{ github.ref }} # this translates to ref/heads/main on the main branch, but can be any arbitrary string
find: '__version__ = "v0.0.0"' # we want to remove ref/heads/ from source
replace: '__version__ = "${{ steps.remote_chart.outputs.tag }}"' # and replace it with a blank string (ie. removing it)
- name: Build bundle
run: |
pyinstaller imswitch.spec
cd dist
cd ImSwitch
dir
- name: Upload updated .exe
uses: actions/upload-artifact@v2
with:
name: imswitch-updated-exeonly
path: dist/ImSwitch/ImSwitch.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: imswitch-${{ matrix.os }}
path: dist
- name: Gets latest created release info
id: latest_release_info
uses: jossef/[email protected]
- name: upload windows-exe-update artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
asset_path: dist/ImSwitch/ImSwitch.exe
asset_name: ImSwitch.exe
asset_content_type: application/exe