Compile pycdc for Windows & Linux #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile pycdc for Windows & Linux | |
on: workflow_dispatch | |
jobs: | |
build-job: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install mingw-w64 | |
run: | | |
sudo apt update | |
sudo apt install -y mingw-w64 | |
- name: Clone pycdc | |
run: git clone --depth=1 https://github.com/zrax/pycdc | |
- name: Compile | |
run: > | |
cd pycdc | |
echo "RELEASE_COMMIT=$(git log -1 --format=%h)" >> ${GITHUB_ENV} | |
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_INCLUDE=ONLY | |
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY | |
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER | |
-DCMAKE_CXX_STANDARD_LIBRARIES="-static-libgcc -static-libstdc++" | |
. | |
make | |
- name: Set release date & time | |
run: | | |
echo "RELEASE_DATE=$(date -u +%d-%b-%Y)" >> ${GITHUB_ENV} | |
echo "RELEASE_TIME=$(date -u +%H:%M)" >> ${GITHUB_ENV} | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: pycdc | |
# path: | | |
# pycdc/pycdc.exe | |
# pycdc/pycdas.exe | |
- name: Create release Windows | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Decompyle++ ${{ env.RELEASE_DATE }} | |
tag: build-${{ env.RELEASE_DATE }}-${{ env.RELEASE_COMMIT }} | |
body: Compiled on ${{ env.RELEASE_DATE }} at ${{ env.RELEASE_TIME }} GMT, pycdc commit ${{ env.RELEASE_COMMIT }} | |
artifacts: "pycdc/pycdc.exe,pycdc/pycdas.exe" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
draft: true | |
- name: Setup latest Alpine Linux | |
uses: jirutka/setup-alpine@v1 | |
with: | |
packages: > | |
alpine-sdk | |
cmake | |
python3 | |
- name: Compile for Linux | |
run: | | |
cd pycdc | |
git clean -d -f -x | |
sed -i '/target_link_libraries(pycdas pycxx)/c target_link_libraries(pycdas pycxx -static)' CMakeLists.txt | |
sed -i '/target_link_libraries(pycdc pycxx)/c target_link_libraries(pycdc pycxx -static)' CMakeLists.txt | |
cmake . | |
make | |
shell: alpine.sh {0} | |
- name: Create release Linux | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Decompyle++ ${{ env.RELEASE_DATE }} | |
tag: build-${{ env.RELEASE_DATE }}-${{ env.RELEASE_COMMIT }} | |
body: Compiled on ${{ env.RELEASE_DATE }} at ${{ env.RELEASE_TIME }} GMT, pycdc commit ${{ env.RELEASE_COMMIT }} | |
artifacts: "pycdc/pycdc,pycdc/pycdas" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
draft: true |