-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (115 loc) Β· 4.1 KB
/
release-workflow.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# This workflow will install Python dependencies, run tests and lint with a single version of Python.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Hamster
on:
push:
branches: [ "main" ]
paths-ignore:
- '**/**.md'
jobs:
build:
runs-on: ${{ matrix.os }}
env:
RELEASE_TAG: v0.0.${{ github.run_number }}
INTEL_DMG: Hamster-x86-64-intel.dmg
ARM64_DMG: Hamster-arm64-silicon.dmg
strategy:
matrix:
# os: [ windows-latest ]
# arch: [ 'X86' ]
os: [ self-hosted, macos, windows ]
arch: [ 'X64', 'ARM64', 'X86' ]
steps:
# - name: Checkout feature/windows branch
# uses: actions/checkout@v3
# with:
# ref: feature/windows
- uses: actions/checkout@v3
- name: Set up Python 3.10.11
uses: actions/setup-python@v3
with:
python-version: "3.10.11"
- name: Install dependencies in Windows
run: |
python -m pip install --upgrade pip
pip install -r .\windows\requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install py2app
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if: matrix.os == 'macos' || matrix.os == 'self-hosted'
- name: Generate app for intel architecture
run: |
python setup.py py2app
mv dist dist-intel
if: matrix.os == 'macos' && matrix.arch == 'X64'
- name: Generate app for arm64 architecture
run: |
python setup.py py2app
mv dist dist-arm64
if: matrix.os == 'self-hosted' && matrix.arch == 'ARM64'
- name: Generate app for windows
run: |
python .\windows\setup.py bdist_msi
mv dist dist-windows
- name: Convert dist-intel to DMG
run: |
hdiutil create -volname "Hamster" -srcfolder dist-intel -ov -format UDZO dist-intel/${{ env.INTEL_DMG }}
if: matrix.os == 'macos' && matrix.arch == 'X64'
- name: Convert dist-arm64 to DMG
run: |
hdiutil create -volname "Hamster" -srcfolder dist-arm64 -ov -format UDZO dist-arm64/${{ env.ARM64_DMG }}
if: matrix.os == 'self-hosted' && matrix.arch == 'ARM64'
- name: Upload intel app
uses: actions/upload-artifact@v2
with:
name: Hamster-macos-intel-x86_64
path: dist-intel/Hamster-intel.dmg
if: matrix.os == 'macos' && matrix.arch == 'X64'
- name: Upload arm64 app
uses: actions/upload-artifact@v2
with:
name: Hamster-macos-apple-arm64
path: dist-arm64/Hamster-darwin.dmg
if: matrix.os == 'self-hosted' && matrix.arch == 'ARM64'
- name: Upload windows app
uses: actions/upload-artifact@v2
with:
name: Hamster-windows-x86_64
path: dist-windows/Hamster-*.msi
- name: GitHub Tag
uses: mathieudutour/[email protected]
with:
tag: ${{ env.RELEASE_TAG }}
github_token: ${{ secrets.HAMSTER_APP_RELEASE_SECRET }}
- name: Release Darwin
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.HAMSTER_APP_RELEASE_SECRET }}
body: 'Release for commit ${{ github.sha }}'
tag_name: ${{ env.RELEASE_TAG }}
generate_release_notes: true
files: |
dist-arm64/${{ env.ARM64_DMG }}
- name: Release Intel
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.HAMSTER_APP_RELEASE_SECRET }}
body: 'Release for commit ${{ github.sha }}'
generate_release_notes: true
tag_name: ${{ env.RELEASE_TAG }}
files: |
dist-intel/${{ env.INTEL_DMG }}
- name: Release Windows
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
token: ${{ secrets.HAMSTER_APP_RELEASE_SECRET }}
body: 'Release for commit ${{ github.sha }}'
generate_release_notes: true
tag_name: ${{ env.RELEASE_TAG }}
files: |
dist-windows/Hamster-*.msi