-
Notifications
You must be signed in to change notification settings - Fork 139
64 lines (61 loc) · 1.94 KB
/
build_seraphine.yaml
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
name: Build Seraphine
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build-seraphine:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Pack Seraphine
run: |
pip install -r requirements.txt
pip install pyinstaller
.\make.ps1
echo "SUCCESS=true" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
if: ${{ env.SUCCESS }} == 'true'
with:
name: Seraphine
path: .\Seraphine.zip
release:
needs: build-seraphine
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment variables
run: |
export VERSION_CHANGED_COMMIT_HASH=$(git blame app/common/config.py --root -l | grep -Po "([\w]+) (?=\(.*\) VERSION = )")
export HEAD_COMMIT_HASH=$(git log -1 --format='%H')
export UPDATED=$(python -c "import os; UPDATED = 'true' if os.environ['HEAD_COMMIT_HASH'].strip() == os.environ['VERSION_CHANGED_COMMIT_HASH'].strip() else 'false'; print(UPDATED)")
export VERSION=$(cat app/common/config.py | grep -Po "(?<=VERSION = \")(.*[^\"])")
echo "VERSION=v$VERSION" >> $GITHUB_ENV
echo "UPDATED=$UPDATED" >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
if: env.UPDATED == 'true'
with:
name: Seraphine
path: ./
- name: Push to release
uses: ncipollo/release-action@v1
if: env.UPDATED == 'true'
with:
name: Seraphine ${{ env.VERSION }}
tag: ${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: false
artifacts: Seraphine.zip