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