-
Notifications
You must be signed in to change notification settings - Fork 6
77 lines (64 loc) · 2.12 KB
/
release2binary.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
name: WurzelimperiumBot Binary Compile and Release
on:
workflow_dispatch:
schedule:
- cron: "59 23 * * *"
jobs:
tag:
name: Create daily tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fregante/daily-version-action@v2
name: Create tag if necessary
id: daily-version
outputs: # Shares the action’s outputs to the Next jobs
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
build:
needs: tag
if: needs.tag.outputs.created
name: Build Windows binary for WurzelimperiumBot
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build binary
run: |
pyinstaller --onefile automated_script.py
pyinstaller --onefile console.py
- name: Copy lang folder
run: Copy-Item -Path "lang" -Destination "dist" -Recurse
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.version }}
release_name: Release ${{ needs.tag.outputs.version }}
body: |
WurzelimperiumBot Win32 CLI
draft: false
prerelease: false
- name: Create zip file
run: Compress-Archive -Path dist\* -DestinationPath ${{ needs.tag.outputs.version }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ needs.tag.outputs.version }}.zip
asset_name: ${{ needs.tag.outputs.version }}.zip
asset_content_type: application/octet-stream