-
Notifications
You must be signed in to change notification settings - Fork 7
157 lines (134 loc) · 5.23 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Release Workflow
on:
push:
tags:
- 'v*'
jobs:
build-windows:
runs-on: windows-2019
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Docker image
run: docker build -f ./windows/Dockerfile -t pyinstaller-windows .
- name: Create dist directory
run: mkdir windows\dist
- name: Run Docker container
run: docker run --rm -v "${{ github.workspace }}\windows\dist:C:\dist" pyinstaller-windows powershell -Command "pyinstaller main.py --name minecraft-mods-localizer-windows-${{ github.ref_name }} --onedir --onefile --clean --console --distpath C:\dist --workpath C:\build --specpath C:\"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: minecraft-mods-localizer-windows
path: windows/dist/minecraft-mods-localizer-windows-${{ github.ref_name }}.exe
build-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12.0'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir pyzipper requests pyinstaller PySimpleGUI
- name: Build with PyInstaller
run: |
pyinstaller --name minecraft-mods-localizer-macos-${{ github.ref_name }} --onefile --clean --console --distpath ./dist --workpath ./build src/main.py
- name: Check Artifacts
run: ls -R ./dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: minecraft-mods-localizer-macos
path: ./dist/minecraft-mods-localizer-macos-${{ github.ref_name }}
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Docker image
run: docker build --no-cache -f ./linux/Dockerfile -t pyinstaller-linux .
- name: Run Docker container
id: run-container
run: |
docker run --rm -v $(pwd)/src:/src -v $(pwd)/linux:/linux \
pyinstaller-linux pyinstaller main.py \
--name minecraft-mods-localizer-linux-${{ github.ref_name }} \
--onedir --onefile --clean --console \
--distpath /linux/dist \
--workpath /linux/build \
--specpath /linux
- name: Check Artifacts
run: ls -R ./linux/dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: minecraft-mods-localizer-linux
path: ./linux/dist/minecraft-mods-localizer-linux-${{ github.ref_name }}
create-release:
needs:
- build-linux
- build-macos
- build-windows
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifact for Windows
uses: actions/download-artifact@v2
with:
name: minecraft-mods-localizer-windows
path: artifacts/windows
- name: Download artifact for MacOS
uses: actions/download-artifact@v2
with:
name: minecraft-mods-localizer-macos
path: artifacts/macos
- name: Download artifact for Linux
uses: actions/download-artifact@v2
with:
name: minecraft-mods-localizer-linux
path: artifacts/linux
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Description of the release
draft: false
prerelease: false
- name: Upload Release Asset for Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/windows/minecraft-mods-localizer-windows-${{ github.ref_name }}.exe
asset_name: minecraft-mods-localizer-windows-${{ github.ref_name }}.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload Release Asset for MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/macos/minecraft-mods-localizer-macos-${{ github.ref_name }}
asset_name: minecraft-mods-localizer-macos-${{ github.ref_name }}
asset_content_type: application/octet-stream
- name: Upload Release Asset for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/linux/minecraft-mods-localizer-linux-${{ github.ref_name }}
asset_name: minecraft-mods-localizer-linux-${{ github.ref_name }}
asset_content_type: application/octet-stream