Skip to content

Commit be64a5f

Browse files
authored
Merge pull request #375 from chrisbra/refactor
Refactor and build Windows Arm64 versions closes: #371
2 parents b408e9f + 56015a3 commit be64a5f

File tree

3 files changed

+344
-113
lines changed

3 files changed

+344
-113
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Build Vim for Windows ARM
2+
3+
on:
4+
push:
5+
tags:
6+
7+
permissions:
8+
id-token: write # needed for attestion
9+
attestations: write
10+
contents: write # needed for release update
11+
12+
jobs:
13+
build-and-release-arm:
14+
runs-on: windows-11-arm
15+
env:
16+
ARCH: x64
17+
DEPENDENCIES: c:\dependencies
18+
GH_TAG_NAME: ${{ github.ref_name }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up MSVC Dev tools
25+
uses: ilammy/msvc-dev-cmd@v1
26+
with:
27+
arch: amd64_arm64
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
c:\dependencies
34+
c:\vcpkg
35+
downloads
36+
key: ${{ runner.os }}
37+
38+
- name: Prepare Vim Build
39+
shell: cmd
40+
run: |
41+
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build;%PATH%"
42+
call vcvarsall.bat x64_arm64
43+
set "VCPKG_ROOT=c:\vcpkg"
44+
call appveyor.bat install
45+
46+
- name: Build Vim (ARM)
47+
shell: cmd
48+
run: |
49+
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build;%PATH%"
50+
call vcvarsall.bat x64_arm64
51+
call appveyor.bat build
52+
53+
# Skip the test for now, it still fails
54+
# - name: Test Vim
55+
# shell: cmd
56+
# run: |
57+
# call appveyor.bat test
58+
59+
- name: Package Vim
60+
shell: cmd
61+
run: |
62+
set "VCPKG_ROOT=c:\vcpkg"
63+
call appveyor.bat package
64+
65+
- name: upload Installer
66+
id: upload-installer
67+
uses: actions/upload-artifact@v4
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
name: arm64-windows-installer.exe
72+
path: |
73+
gvim*.exe
74+
75+
- name: Attest Installer
76+
uses: actions/attest-build-provenance@v2
77+
with:
78+
subject-name: arm64-windows-installer.exe
79+
subject-digest: sha256:${{ steps.upload-installer.outputs.artifact-digest }}
80+
81+
- name: upload Zip File
82+
id: upload-zip
83+
uses: actions/upload-artifact@v4
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
name: arm64-windows-zip-archive.zip
88+
path: |
89+
gvim*.zip
90+
91+
- name: Attest Zip File
92+
uses: actions/attest-build-provenance@v2
93+
with:
94+
subject-name: arm64-windows-zip-archive.zip
95+
subject-digest: sha256:${{ steps.upload-zip.outputs.artifact-digest }}
96+
97+
# the release will be created by the appveyor CI, so we need to wait
98+
# until it exists before trying to push our release artifacts
99+
- name: Wait for Github Release
100+
shell: bash
101+
env:
102+
TAG_NAME: ${{ github.ref_name }}
103+
run: |
104+
echo "Waiting for release with tag $TAG_NAME..."
105+
for i in {1..30}; do
106+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
107+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
108+
https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME)
109+
110+
if [ "$STATUS" -eq 200 ]; then
111+
echo "✅ Release $TAG_NAME exists!"
112+
exit 0
113+
else
114+
echo "⏳ Attempt $i: Release not found yet. Waiting 60s..."
115+
sleep 60
116+
fi
117+
done
118+
119+
echo "❌ Timed out waiting for release $TAG_NAME"
120+
exit 1
121+
122+
- name: Upload to Github Release
123+
shell: bash
124+
env:
125+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126+
run: |
127+
for i in gvim*.exe gvim*.zip; do
128+
gh release upload "$GH_TAG_NAME" "$i" --clobber
129+
done
130+
131+
- name: Post Summary
132+
run: |
133+
echo "## ✅ Windows ARM Build Summary" >> $GITHUB_STEP_SUMMARY
134+
echo "" >> $GITHUB_STEP_SUMMARY
135+
echo "**Tag:** \`$GH_TAG_NAME\`" >> $GITHUB_STEP_SUMMARY
136+
echo "**Repository:** \`${{ github.repository }}\`" >> $GITHUB_STEP_SUMMARY
137+
echo "**Artifacts Uploaded:**" >> $GITHUB_STEP_SUMMARY
138+
echo "- 🟩 [arm64-windows-installer.exe](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
139+
echo "- 🟦 [arm64-windows-zip-archive.zip](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
140+
echo "" >> $GITHUB_STEP_SUMMARY
141+
echo "**Release Status:**" >> $GITHUB_STEP_SUMMARY
142+
echo "- 🔁 Waited for tag \`$GH_TAG_NAME\` to become available as a release" >> $GITHUB_STEP_SUMMARY
143+
echo "- 📦 Uploaded artifacts to the release via \`gh release upload\`" >> $GITHUB_STEP_SUMMARY
144+
echo "" >> $GITHUB_STEP_SUMMARY
145+
echo "**Security Provenance:**" >> $GITHUB_STEP_SUMMARY
146+
echo "- 🔒 Attested \`arm64-windows-installer.exe\` and \`arm64-windows-zip-archive.zip\` using [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance)" >> $GITHUB_STEP_SUMMARY

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Latest GitHub Release](https://img.shields.io/github/v/release/vim/vim-win32-installer)](https://github.com/vim/vim-win32-installer/releases/latest)
44

55

6-
# Vim Installer and Archives (Win32, Win64, ARM64)
6+
# Vim Installer and Vim Zip-Archives (Win32, Win64, ARM64)
77

88
This is a project for building Nightly and Stable Vim Windows build snapshots
99
automatically ([more information](https://vim.fandom.com/wiki/Where_to_download_Vim)).
@@ -41,7 +41,10 @@ You can find those interperters here:
4141
Make sure that you install the same architecture (32bit/64bit) for those
4242
libraries that matches your Vim installation.
4343

44-
For Python 3, Vim is compiled against Python 3.12 using [Stable ABI](https://docs.python.org/3.12/c-api/stable.html), and this allows you to use Python 3.8 or any later version. See also `:help python3-stable-abi`.
44+
For Python 3, Vim is compiled against Python 3.12 using [Stable
45+
ABI](https://docs.python.org/3.12/c-api/stable.html), and this allows you to
46+
use Python 3.8 or any later version. See also
47+
[`:help python3-stable-abi`](https://vimhelp.org/if_pyth.txt.html#python3-stable-abi)
4548

4649
Additionally the binaries include the new terminal feature for Vim and
4750
therefore contain the winpty.dll (32bit or 64bit) and the winpty-agent.exe from
@@ -76,7 +79,11 @@ occasionaly. If there haven't been any signed
7679
releases for a long time, feel free to request a new one by creating an
7780
[issue](https://github.com/vim/vim-win32-installer/issues) here.
7881

79-
Thanks to [SignPath.io](https://signpath.io?utm_source=foundation&utm_medium=github&utm_campaign=vim) for providing a free code signing service and to the [SignPath Foundation](https://signpath.org?utm_source=foundation&utm_medium=github&utm_campaign=vim) for a free code signing certificate to sign the builds.
82+
Thanks to
83+
[SignPath.io](https://signpath.io?utm_source=foundation&utm_medium=github&utm_campaign=vim)
84+
for providing a free code signing service and to the [SignPath
85+
Foundation](https://signpath.org?utm_source=foundation&utm_medium=github&utm_campaign=vim)
86+
for a free code signing certificate to sign the builds.
8087

8188
## Winget
8289
The nightly builds will be automatically uploaded and submitted to the [winget

0 commit comments

Comments
 (0)