Skip to content

Compile pycdc for Windows & Linux #33

Compile pycdc for Windows & Linux

Compile pycdc for Windows & Linux #33

Workflow file for this run

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 x86_64
uses: jirutka/setup-alpine@v1
with:
packages: >
alpine-sdk
cmake
python3
- name: Compile for Linux x86_64
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
mv pycdc pycdc.x86_64
mv pycdas pycdas.x86_64
shell: alpine.sh {0}
- name: Create release Linux x86_64
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.x86_64,pycdc/pycdas.x86_64"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
- name: Setup latest Alpine Linux aarch64
uses: jirutka/setup-alpine@v1
with:
arch: aarch64
packages: >
alpine-sdk
cmake
python3
- name: Compile for Linux AArch64
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
mv pycdc pycdc.aarch64
mv pycdas pycdas.aarch64
shell: alpine.sh {0}
- name: Create release Linux aarch64
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.aarch64,pycdc/pycdas.aarch64"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true