Skip to content

Commit 1611b55

Browse files
committed
Build AArch64 Cygwin using Ubuntu cross-toolchain
1 parent 8569130 commit 1611b55

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/cygwin.yml

Lines changed: 101 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,107 @@ 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 update
116+
sudo apt-get install -y \
117+
autoconf \
118+
automake \
119+
dblatex \
120+
docbook2x \
121+
docbook-xsl \
122+
gawk \
123+
gcc-mingw-w64 \
124+
make \
125+
openssh-client \
126+
patch \
127+
perl \
128+
python3 \
129+
python3-lxml \
130+
python3-ply \
131+
xmlto
132+
133+
# download toolchain
134+
- name: Download toolchain
135+
run: |
136+
gh release download \
137+
--repo Windows-on-ARM-Experiments/mingw-woarm64-build \
138+
--pattern aarch64-pc-cygwin-msvcrt-toolchain.tar.gz
139+
mkdir -p toolchain
140+
tar -xzf aarch64-pc-cygwin-msvcrt-toolchain.tar.gz -C toolchain
141+
142+
# build
143+
- name: Configure, build and install
144+
run: |
145+
export PATH="$PATH:${{ github.workspace }}/toolchain/bin"
146+
mkdir build install
147+
(cd winsup && ./autogen.sh)
148+
(cd build && ../configure --target=${{ matrix.target }} --prefix=$(realpath $(pwd)/../install) )
149+
make -C build
150+
make -C build/*/newlib info man
151+
make -C build install
152+
make -C build/*/newlib install-info install-man
153+
154+
- name: Upload build folder
155+
if: failure()
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: build
159+
retention-days: 1
160+
path: ${{ github.workspace }}
161+
162+
# deploy documentation
163+
- name: Deploy documentation
164+
env:
165+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
166+
run: |
167+
# pushes to main are deployed as preview
168+
# pushes to cygwin-n.n.n (but not 'cygwin-n.n.n.dev') tags are deployed as stable
169+
# other references are ignored by this step
170+
case "${{ github.ref }}" in
171+
refs/heads/main)
172+
DEST='preview'
173+
;;
174+
refs/tags/cygwin-[0-9.]*)
175+
DEST='stable'
176+
;;
177+
*)
178+
exit 0
179+
;;
180+
esac
181+
# unfuck github fuckery of HOME in a container
182+
unset HOME
183+
# add the hosts public key to known_hosts
184+
mkdir -p ~/.ssh/
185+
echo "cygwin.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoejTnTCbXaIIMYfbX7t4tYUOQ2bTxZC3e/td3BageF" >> ~/.ssh/known_hosts
186+
# load the key (restricted to scp only) into ssh-agent
187+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
188+
ssh-add - <<< "${{ secrets.SSH_KEY }}"
189+
# 'make install' doesn't install faq, so instead just deploy from build directory
190+
scp -pr build/*/winsup/doc/{cygwin-api,cygwin-ug-net,faq} [email protected]:/sourceware/www/sourceware/htdocs/cygwin/doc/${DEST}/
191+
if: env.HAS_SSH_KEY == 'true'
192+
93193
windows-build:
194+
if: false
94195
runs-on: windows-latest
95196
strategy:
96197
fail-fast: false

0 commit comments

Comments
 (0)