-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (57 loc) · 1.86 KB
/
build.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
name: Build sb binary
on:
workflow_dispatch:
push:
paths:
- '*.py'
- 'requirements/**'
tags:
- '*'
pull_request:
paths:
- '*.py'
- 'requirements/**'
permissions:
contents: write
actions: write
jobs:
build:
runs-on: self-hosted
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Setup venv
run: python3.12 -m venv venv
- name: Install Dependencies
run: ./venv/bin/pip install --disable-pip-version-check -r requirements/requirements.txt
- name: List Pip modules
run: ./venv/bin/pip list
- name: Prepare script with version
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "Building with version ${VERSION}"
sed -i "s/__version__ = \"0.0.0\"/__version__ = \"${VERSION}\"/" sb.py
- name: Compile binary
run: ./venv/bin/python -m nuitka sb.py --onefile -o sb && chmod +x sb
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/') != true
uses: actions/upload-artifact@v4
with:
name: sb
path: sb
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
files: |
sb
- name: Run release workflow
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
run: gh workflow run release.yml -f release_tag=${{ github.ref }}
env:
GH_TOKEN: ${{ github.token }}
- uses: sarisia/actions-status-discord@v1
if: always() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}