Skip to content

Commit e9b16c2

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

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

.github/workflows/cygwin.yml

Lines changed: 87 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,93 @@ 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 toolchain
124+
tar -xzf aarch64-w64-mingw32-msvcrt-toolchain.tar.gz -C toolchain
125+
126+
# build
127+
- name: Configure, build and install
128+
run: |
129+
export PATH="$PATH:${{ github.workspace }}/toolchain/bin"
130+
ls -al ${{ github.workspace }}/toolchain/bin
131+
which aarch64-pc-cygwin-gcc
132+
mkdir build install
133+
(cd winsup && ./autogen.sh)
134+
(cd build && ../configure --target=${{ matrix.target }} --prefix=$(realpath $(pwd)/../install) )
135+
make -C build
136+
make -C build/*/newlib info man
137+
make -C build install
138+
make -C build/*/newlib install-info install-man
139+
140+
- name: Upload build folder
141+
if: failure()
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: build
145+
retention-days: 1
146+
path: ${{ github.workspace }}
147+
148+
# deploy documentation
149+
- name: Deploy documentation
150+
env:
151+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
152+
run: |
153+
# pushes to main are deployed as preview
154+
# pushes to cygwin-n.n.n (but not 'cygwin-n.n.n.dev') tags are deployed as stable
155+
# other references are ignored by this step
156+
case "${{ github.ref }}" in
157+
refs/heads/main)
158+
DEST='preview'
159+
;;
160+
refs/tags/cygwin-[0-9.]*)
161+
DEST='stable'
162+
;;
163+
*)
164+
exit 0
165+
;;
166+
esac
167+
# unfuck github fuckery of HOME in a container
168+
unset HOME
169+
# add the hosts public key to known_hosts
170+
mkdir -p ~/.ssh/
171+
echo "cygwin.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoejTnTCbXaIIMYfbX7t4tYUOQ2bTxZC3e/td3BageF" >> ~/.ssh/known_hosts
172+
# load the key (restricted to scp only) into ssh-agent
173+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
174+
ssh-add - <<< "${{ secrets.SSH_KEY }}"
175+
# 'make install' doesn't install faq, so instead just deploy from build directory
176+
scp -pr build/*/winsup/doc/{cygwin-api,cygwin-ug-net,faq} [email protected]:/sourceware/www/sourceware/htdocs/cygwin/doc/${DEST}/
177+
if: env.HAS_SSH_KEY == 'true'
178+
93179
windows-build:
180+
if: false
94181
runs-on: windows-latest
95182
strategy:
96183
fail-fast: false

0 commit comments

Comments
 (0)