Skip to content

Commit a0a569f

Browse files
committed
Fix release
1 parent e6fa999 commit a0a569f

2 files changed

Lines changed: 19 additions & 132 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ permissions:
1111
jobs:
1212
release:
1313
if: startsWith(github.ref, 'refs/tags/')
14-
1514
runs-on: ubuntu-latest
15+
outputs:
16+
upload_url: ${{ steps.create_release.outputs.upload_url }}
1617

1718
steps:
1819
- name: Build Changelog
@@ -42,122 +43,18 @@ jobs:
4243
4344
- name: Create Release
4445
id: create_release
45-
uses: mikepenz/action-gh-release@v0.2.0-a03
46+
uses: softprops/action-gh-release@v2
4647
with:
4748
body: ${{steps.github_release.outputs.changelog}}
4849
draft: true
4950
prerelease: true
5051

51-
- name: Create release url file
52-
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
53-
54-
- name: Save release url file for publish
55-
uses: actions/upload-artifact@v1
56-
with:
57-
name: release_url
58-
path: release_url.txt
59-
60-
publish:
61-
needs: [release]
62-
63-
strategy:
64-
matrix:
65-
os: [ubuntu-latest, windows-latest]
66-
67-
runs-on: ${{ matrix.os }}
68-
69-
steps:
70-
- uses: actions/checkout@v2
71-
with:
72-
submodules: true
73-
74-
- uses: conda-incubator/setup-miniconda@v2
75-
with:
76-
python-version: "3.10.14"
77-
miniconda-version: "latest"
78-
79-
- name: Set preferred device to CPU
80-
shell: bash -l {0}
81-
run: >-
82-
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "CPU"/g' anylabeling/app_info.py
83-
84-
- name: Install main
85-
shell: bash -l {0}
86-
run: |
87-
pip install .
88-
89-
- name: Install PyQt5 for macOS
90-
shell: bash -l {0}
91-
run: |
92-
conda install -c conda-forge pyqt==5.15.7
93-
if: runner.os == 'macOS'
94-
95-
- name: Run pyinstaller
96-
shell: bash -l {0}
97-
run: |
98-
pip install pyinstaller
99-
pyinstaller anylabeling.spec
100-
101-
- name: Load release url file from release job
102-
uses: actions/download-artifact@v1
103-
with:
104-
name: release_url
105-
106-
- name: Get release file name & upload url
107-
id: get_release_info
108-
run: |
109-
echo "::set-output name=upload_url::$(cat release_url/release_url.txt)"
110-
111-
- name: Upload release executable on macOS & Linux
112-
id: upload_release_executable_macos_linux
113-
uses: actions/upload-release-asset@v1
114-
env:
115-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116-
with:
117-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
118-
asset_path: ./dist/anylabeling
119-
asset_name: AnyLabeling-${{ runner.os }}
120-
asset_content_type: application/octet-stream
121-
if: runner.os != 'Windows'
122-
123-
- name: Upload release executable on Windows
124-
id: upload_release_executable_windows
125-
uses: actions/upload-release-asset@v1
126-
env:
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128-
with:
129-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
130-
asset_path: ./dist/anylabeling.exe
131-
asset_name: AnyLabeling.exe
132-
asset_content_type: application/octet-stream
133-
if: runner.os == 'Windows'
134-
135-
- name: Create dmg for macOS
136-
run: |
137-
npm install -g create-dmg
138-
cd dist
139-
create-dmg AnyLabeling.app || test -f AnyLabeling\ 0.0.0.dmg
140-
mv AnyLabeling\ 0.0.0.dmg AnyLabeling.dmg
141-
if: runner.os == 'macOS'
142-
143-
- name: Upload release app on macOS
144-
id: upload_release_app_macos
145-
uses: actions/upload-release-asset@v1
146-
env:
147-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148-
with:
149-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
150-
asset_path: ./dist/AnyLabeling.dmg
151-
asset_name: AnyLabeling.dmg
152-
asset_content_type: application/octet-stream
153-
if: runner.os == 'macOS'
154-
155-
publish-gpu:
52+
build:
15653
needs: [release]
157-
15854
strategy:
15955
matrix:
16056
os: [ubuntu-latest, windows-latest]
57+
device: [CPU, GPU]
16158

16259
runs-on: ${{ matrix.os }}
16360

@@ -171,10 +68,10 @@ jobs:
17168
python-version: "3.10.14"
17269
miniconda-version: "latest"
17370

174-
- name: Set preferred device to GPU
71+
- name: Set preferred device
17572
shell: bash -l {0}
17673
run: >-
177-
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "GPU"/g' anylabeling/app_info.py
74+
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "${{ matrix.device }}"/g' anylabeling/app_info.py
17875
17976
- name: Install main
18077
shell: bash -l {0}
@@ -193,37 +90,27 @@ jobs:
19390
pip install pyinstaller
19491
pyinstaller anylabeling.spec
19592
196-
- name: Load release url file from release job
197-
uses: actions/download-artifact@v1
198-
with:
199-
name: release_url
200-
201-
- name: Get release file name & upload url
202-
id: get_release_info
203-
run: |
204-
echo "::set-output name=upload_url::$(cat release_url/release_url.txt)"
205-
20693
- name: Upload release executable on macOS & Linux
20794
id: upload_release_executable_macos_linux
208-
uses: actions/upload-release-asset@v1
95+
uses: softprops/action-gh-release@v2
20996
env:
21097
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21198
with:
212-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
99+
upload_url: ${{ needs.release.outputs.upload_url }}
213100
asset_path: ./dist/anylabeling
214-
asset_name: AnyLabeling-${{ runner.os }}-GPU
101+
asset_name: AnyLabeling-${{ runner.os }}${{ matrix.device == 'GPU' && '-GPU' || '' }}
215102
asset_content_type: application/octet-stream
216103
if: runner.os != 'Windows'
217104

218105
- name: Upload release executable on Windows
219106
id: upload_release_executable_windows
220-
uses: actions/upload-release-asset@v1
107+
uses: softprops/action-gh-release@v2
221108
env:
222109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223110
with:
224-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
111+
upload_url: ${{ needs.release.outputs.upload_url }}
225112
asset_path: ./dist/anylabeling.exe
226-
asset_name: AnyLabeling-GPU.exe
113+
asset_name: AnyLabeling${{ matrix.device == 'GPU' && '-GPU' || '' }}.exe
227114
asset_content_type: application/octet-stream
228115
if: runner.os == 'Windows'
229116

@@ -232,17 +119,17 @@ jobs:
232119
npm install -g create-dmg
233120
cd dist
234121
create-dmg AnyLabeling.app || test -f AnyLabeling\ 0.0.0.dmg
235-
mv AnyLabeling\ 0.0.0.dmg AnyLabeling-GPU.dmg
122+
mv AnyLabeling\ 0.0.0.dmg AnyLabeling${{ matrix.device == 'GPU' && '-GPU' || '' }}.dmg
236123
if: runner.os == 'macOS'
237124

238125
- name: Upload release app on macOS
239126
id: upload_release_app_macos
240-
uses: actions/upload-release-asset@v1
127+
uses: softprops/action-gh-release@v2
241128
env:
242129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
243130
with:
244-
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
245-
asset_path: ./dist/AnyLabeling-GPU.dmg
246-
asset_name: AnyLabeling-GPU.dmg
131+
upload_url: ${{ needs.release.outputs.upload_url }}
132+
asset_path: ./dist/AnyLabeling${{ matrix.device == 'GPU' && '-GPU' || '' }}.dmg
133+
asset_name: AnyLabeling${{ matrix.device == 'GPU' && '-GPU' || '' }}.dmg
247134
asset_content_type: application/octet-stream
248135
if: runner.os == 'macOS'

anylabeling/app_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__appname__ = "AnyLabeling"
22
__appdescription__ = "Effortless data labeling with AI support"
3-
__version__ = "0.4.11"
3+
__version__ = "0.4.15"
44
__preferred_device__ = "CPU" # GPU or CPU

0 commit comments

Comments
 (0)