Skip to content

Commit d920d8c

Browse files
committed
Build AArch64 and x86_64 Cygwin using Ubuntu cross-toolchain
1 parent 8569130 commit d920d8c

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/cygwin.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
jobs:
1212
fedora-build:
13+
if: false
1314
runs-on: ubuntu-latest
1415
container: fedora:latest
1516
strategy:
@@ -90,7 +91,83 @@ jobs:
9091
scp -pr build/*/winsup/doc/{cygwin-api,cygwin-ug-net,faq} [email protected]:/sourceware/www/sourceware/htdocs/cygwin/doc/${DEST}/
9192
if: env.HAS_SSH_KEY == 'true'
9293

94+
ubuntu-build:
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
include:
99+
- target: aarch64-pc-cygwin
100+
runner: ubuntu-24.04-arm
101+
102+
runs-on: ${{ matrix.runner }}
103+
name: Ubuntu cross ${{ matrix.target }}
104+
105+
env:
106+
GH_TOKEN: ${{ github.token }}
107+
HAS_SSH_KEY: ${{ secrets.SSH_KEY != '' }}
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
# install build tools
113+
- name: Install build tools
114+
run: |
115+
sudo apt-get install -y autoconf automake gawk make patch perl
116+
117+
# download toolchain
118+
- name: Download toolchain
119+
run: |
120+
gh release download \
121+
--repo Windows-on-ARM-Experiments/mingw-woarm64-build \
122+
--pattern aarch64-w64-mingw32-msvcrt-toolchain.tar.gz
123+
mkdir -p cross && tar -xzf aarch64-w64-mingw32-msvcrt-toolchain.tar.gz cross/
124+
ls -al
125+
ls -al cross/
126+
127+
# build
128+
- name: Configure, build and install
129+
run: |
130+
mkdir build install
131+
(cd winsup && ./autogen.sh)
132+
(cd build && ../configure --target=${{ matrix.target }} --prefix=$(realpath $(pwd)/../install) )
133+
make -C build
134+
make -C build/*/newlib info man
135+
make -C build install
136+
make -C build/*/newlib install-info install-man
137+
138+
# deploy documentation
139+
- name: Deploy documentation
140+
env:
141+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
142+
run: |
143+
# pushes to main are deployed as preview
144+
# pushes to cygwin-n.n.n (but not 'cygwin-n.n.n.dev') tags are deployed as stable
145+
# other references are ignored by this step
146+
case "${{ github.ref }}" in
147+
refs/heads/main)
148+
DEST='preview'
149+
;;
150+
refs/tags/cygwin-[0-9.]*)
151+
DEST='stable'
152+
;;
153+
*)
154+
exit 0
155+
;;
156+
esac
157+
# unfuck github fuckery of HOME in a container
158+
unset HOME
159+
# add the hosts public key to known_hosts
160+
mkdir -p ~/.ssh/
161+
echo "cygwin.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoejTnTCbXaIIMYfbX7t4tYUOQ2bTxZC3e/td3BageF" >> ~/.ssh/known_hosts
162+
# load the key (restricted to scp only) into ssh-agent
163+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
164+
ssh-add - <<< "${{ secrets.SSH_KEY }}"
165+
# 'make install' doesn't install faq, so instead just deploy from build directory
166+
scp -pr build/*/winsup/doc/{cygwin-api,cygwin-ug-net,faq} [email protected]:/sourceware/www/sourceware/htdocs/cygwin/doc/${DEST}/
167+
if: env.HAS_SSH_KEY == 'true'
168+
93169
windows-build:
170+
if: false
94171
runs-on: windows-latest
95172
strategy:
96173
fail-fast: false

0 commit comments

Comments
 (0)