-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (67 loc) · 2.58 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
69
70
71
72
73
74
name: Build Decompyle++
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current repo
uses: actions/checkout@v3
- name: Get Latest Commit
run: |
git clone --depth=1 https://github.com/zrax/pycdc
cd pycdc
last_commit=$(git log -1 --format=%h)
cd ..
if [ "$(cat ./commit)" = "$last_commit" ]; then
echo "Latest Release Available.Stopping workflow..."
echo "RECENT_COMMIT=False" >> ${GITHUB_ENV}
else
echo "RECENT_COMMIT=True" >> ${GITHUB_ENV}
echo "RECENT_COM=$last_commit" >> ${GITHUB_ENV}
fi
- name: Setup MinGW
if: ${{env.RECENT_COMMIT == 'True'}}
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
- name: Compile for Windows
if: ${{env.RECENT_COMMIT == 'True'}}
run: |
cd pycdc
cmake -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ \
-DCMAKE_FIND_ROOT_PATH=/usr/i686-w64-mingw32 \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_CXX_STANDARD_LIBRARIES="-static-libgcc -static-libstdc++" \
.
make
- name: Generate build artifacts
if: ${{env.RECENT_COMMIT == 'True'}}
run: |
echo "DATE=$(date -u '+%B %d')" >> ${GITHUB_ENV}
git clone --depth=1 https://github.com/zrax/pycdc pycdc-src && zip -r pycdc-src.zip pycdc-src
mkdir -p pycdc-windows
test -d ./pycdc && mv ./pycdc/pycdc.exe ./pycdc/pycdas.exe ./pycdc-windows/
zip -r pycdc-windows.zip pycdc-windows
- name: Create Release
if: ${{env.RECENT_COMMIT == 'True'}}
uses: ncipollo/release-action@v1
with:
name: Decompyle++ Build ${{ env.DATE }}
artifacts: "*.zip"
tag: build-${{ env.RECENT_COM }}
body: "**Commit** [${{ env.RECENT_COM }}](https://github.com/zrax/pycdc/commit/${{ env.RECENT_COM }})\nBuilt on : ${{ env.DATE }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit to Repo
if: ${{env.RECENT_COMMIT == 'True'}}
run: |
echo "${{ env.RECENT_COM }}" > ./commit
git config user.name Catz
git config user.email [email protected]
git add ./commit && git commit -m "${{ env.RECENT_COM }}" && git push