Skip to content

ci: cross-compile in linux container #258

ci: cross-compile in linux container

ci: cross-compile in linux container #258

Workflow file for this run

name: CI
env:
VER_MAJOR: 24
VER_MINOR: 10
VER_PATCH: 1
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
merge_group:
types: [checks_requested]
workflow_call:
inputs:
nightly:
description: "Update all submodules to build nightly build"
default: true
required: false
type: boolean
outputs:
unsigned-artifact-id:
description: "Unsigned Installer"
value: ${{ jobs.build.outputs.unsigned-artifact-id }}
jobs:
cross-build:
runs-on: ubuntu-latest
container: quay.io/fedora/fedora:42
name: Cross Build
steps:
- name: Install build dependencies
run: |
sudo dnf -y install clang sqlite-devel rustup git
sudo dnf -y install mingw32-binutils mingw32-gcc mingw32-sqlite-static mingw32-zlib-static
sudo dnf -y install mingw64-binutils mingw64-gcc mingw64-sqlite-static mingw64-zlib-static
rustup-init -y
source "$HOME/.cargo/env"
rustup set auto-self-update disable
rustup target add i686-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu
- uses: actions/checkout@v4
with:
submodules: true
- name: Update Submodules
if: ${{ inputs.nightly }}
run: git submodule update --remote
- name: Generate nightly version info
if: ${{ inputs.nightly }}
run: |
source "$HOME/.cargo/env"
cargo xtask update-version --major $VER_MAJOR --minor $VER_MINOR --patch $VER_PATCH -b $GITHUB_RUN_NUMBER
cat version.rc
cat installer/version.wxi
- name: Generate pull_request version info
if: github.event_name == 'pull_request'
env:
PR_NUMBER: ${{ github.event.number }}
run: |
source "$HOME/.cargo/env"
cargo xtask update-version --major 0 --minor 0 --patch $PR_NUMBER -b $GITHUB_RUN_NUMBER
cat version.rc
cat installer/version.wxi
- name: Build
run: |
source "$HOME/.cargo/env"
sh scripts/cross_build.sh
- uses: actions/upload-artifact@v4
with:
name: Installer Artifact
path: build/installer
build:
runs-on: windows-latest
name: Package
outputs:
unsigned-artifact-id: ${{ steps.upload-unsigned.outputs.artifact-id }}
needs: [cross-build]
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# - name: Start SSH session
# uses: luchihoratiu/debug-via-ssh@main
# with:
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_TOKEN }}
# SSH_PASS: ${{ secrets.SSH_PASS }}
# NGROK_REGION: jp
- name: Download Installer Artifact
uses: actions/download-artifact@v4
with:
name: Installer Artifact
path: build/installer
- name: Build Package
shell: cmd
run: |
scripts/package_installer.bat
- id: upload-unsigned
uses: actions/upload-artifact@v4
with:
name: Unsigned Installer
path: |
dist\windows-chewing-tsf-unsigned.msi