Skip to content

Fix build errors

Fix build errors #493

Workflow file for this run

name: Build
on:
push:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
# createrelease:
# name: Create Release
# runs-on: [ubuntu-latest]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Create Release
# uses: ncipollo/release-action@v1
# with:
# token: "${{ secrets.GITHUB_TOKEN }}"
# name: Release ${{ github.ref_name }}
# build-wheel:
# name: Build wheel
# needs: createrelease
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Build SDist and wheel
# run: pipx run build
# - name: Test SDist
# run: pip install dist/*.tar.gz
# - uses: actions/upload-artifact@v4
# with:
# path: dist/*
build-binary:
name: Build packages
needs: createrelease
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2022
TARGET: windows
CMD_BUILD: |
python compile.py
move sticker-convert.dist sticker-convert
Compress-Archive -Path sticker-convert -DestinationPath sticker-convert-windows-x86_64.zip
dotnet tool install --global wix --version 4.0.4
wix extension add WixToolset.UI.wixext/4.0.4
python .\msicreator\createmsi.py msicreator.json
move *.msi sticker-convert-windows-x86_64.msi
OUT_FILE_NAME: |
./sticker-convert-windows-x86_64.zip
./sticker-convert-windows-x86_64.msi
- os: macos-13
TARGET: macos-x86_64
CMD_BUILD: |
python ./compile.py
cp ./scripts/hold_control_and_click_open_me_first.command ./
zip -r9 sticker-convert-macos-x86_64.zip sticker-convert.app hold_control_and_click_open_me_first.command
OUT_FILE_NAME: ./sticker-convert-macos-x86_64.zip
- os: macos-14
TARGET: macos-arm64
CMD_BUILD: |
python ./compile.py
cp ./scripts/hold_control_and_click_open_me_first.command ./
zip -r9 sticker-convert-macos-arm64.zip sticker-convert.app hold_control_and_click_open_me_first.command
OUT_FILE_NAME: ./sticker-convert-macos-arm64.zip
- os: ubuntu-20.04
image: docker://quay.io/pypa/manylinux2014_x86_64
TARGET: linux-x86_64
CMD_BUILD: |
python ./compile.py
zip -r9 sticker-convert-linux-x86_64.zip ./sticker-convert.dist/*
SC_COMPILE_ARCH=x86_64 ./scripts/build_appimage.sh
OUT_FILE_NAME: ./sticker-convert-x86_64.AppImage
- os: ubuntu-20.04
image: docker://quay.io/pypa/manylinux2014_aarch64
TARGET: linux-aarch64
CMD_BUILD: |
python ./compile.py
zip -r9 sticker-convert-linux-aarch64.zip ./sticker-convert.dist/*
SC_COMPILE_ARCH=aarch64 ./scripts/build_appimage.sh
OUT_FILE_NAME: ./sticker-convert-aarch64.AppImage
steps:
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
allow-prereleases: true
- name: Build for ${{matrix.TARGET}} (Linux)
if: runner.os == 'Linux'
uses: ${{ matrix.image || '' }}
with:
args: ${{matrix.CMD_BUILD}}
- name: Build for ${{matrix.TARGET}}
if: runner.os != 'Linux'
run: ${{matrix.CMD_BUILD}}
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.TARGET}}
path: |
'*.AppImage'
'*.zip'
# - name: Upload Release Asset
# id: upload-release-asset
# uses: softprops/action-gh-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: ${{ matrix.OUT_FILE_NAME }}
# build-docker:
# name: Build Docker image and push
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Extract metadata (tags, labels) for Docker (min-cli)
# id: meta_min_cli
# uses: docker/metadata-action@v5
# with:
# images: |
# ${{ github.repository }}
# ghcr.io/${{ github.repository }}
# flavor: |
# suffix=-min-cli,onlatest=true
# - name: Extract metadata (tags, labels) for Docker (min-gui)
# id: meta_min_gui
# uses: docker/metadata-action@v5
# with:
# images: |
# ${{ github.repository }}
# ghcr.io/${{ github.repository }}
# flavor: |
# suffix=-min-gui,onlatest=true
# - name: Extract metadata (tags, labels) for Docker (full)
# id: meta_full
# uses: docker/metadata-action@v5
# with:
# images: |
# ${{ github.repository }}
# ghcr.io/${{ github.repository }}
# - name: Build and push Docker image (min-cli)
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta_min_cli.outputs.tags }}
# labels: ${{ steps.meta_min_cli.outputs.labels }}
# target: min-cli
# - name: Build and push Docker image (min-gui)
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta_min_gui.outputs.tags }}
# labels: ${{ steps.meta_min_gui.outputs.labels }}
# target: min-gui
# - name: Build and push Docker image (full)
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta_full.outputs.tags }}
# labels: ${{ steps.meta_full.outputs.labels }}
# target: full
# upload-pypi:
# name: Upload to pypi
# needs: [build-wheel, build-binary]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# # unpacks default artifact into dist/
# # if `name: artifact` is omitted, the action will create extra parent dir
# name: artifact
# path: dist
# - uses: pypa/gh-action-pypi-publish@v1.5.0
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}