This commit is contained in:
Данила Горнушко 2024-12-04 20:24:17 +03:00
parent 834194f731
commit d0529b01ce

View file

@ -0,0 +1,46 @@
name: Cross-Compile for Windows with Podman
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Rust
uses: https://github.com/actions/setup-rust@v1
with:
profile: minimal
toolchain: stable
components: rust-src
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y podman uidmap fuse-overlayfs
mkdir -p ~/.config/containers
- name: Configure Rootless Podman
run: |
sudo sh -c "echo 'runner:100000:65536' >> /etc/subuid"
sudo sh -c "echo 'runner:100000:65536' >> /etc/subgid"
export XDG_RUNTIME_DIR=/tmp/runtime-runner
mkdir -p $XDG_RUNTIME_DIR
podman info
- name: Install cross
run: cargo install cross
- name: Build with cross using Podman
env:
CROSS_CONTAINER_ENGINE: podman
XDG_RUNTIME_DIR: /tmp/runtime-runner
run: cross build --target x86_64-pc-windows-gnu -r