Skip to content

Commit a6eac20

Browse files
committed
pc?ul: workflow for Windows 7 build
1 parent 7e6919a commit a6eac20

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build Windows 7 Release
2+
3+
on:
4+
workflow_dispatch: # Allows manual triggering from Actions tab
5+
6+
jobs:
7+
build-windows7:
8+
runs-on: windows-latest
9+
10+
steps:
11+
- name: Checkout divrep repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0 # Get full history for SHA
15+
16+
- name: Set up Cygwin
17+
uses: cygwin/cygwin-install-action@master
18+
with:
19+
packages: gcc-core,libgmp-devel,make,git,binutils
20+
site: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2024/01/30/231215
21+
check-installer-sig: false
22+
check-sig: false
23+
24+
- name: Clone Math-Prime-Util-GMP
25+
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
26+
run: |
27+
cd /cygdrive/c/cygwin/home
28+
git clone https://github.com/hvds/Math-Prime-Util-GMP.git
29+
cd Math-Prime-Util-GMP
30+
git checkout simpqs-full
31+
32+
- name: Build pcoul
33+
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
34+
run: |
35+
cd "$GITHUB_WORKSPACE"
36+
MPUGMP=/cygdrive/c/cygwin/home/Math-Prime-Util-GMP MPUGMP_VER=2389dcbc44 make pcoul
37+
38+
- name: Strip executable
39+
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
40+
run: |
41+
cd "$GITHUB_WORKSPACE"
42+
strip pcoul.exe
43+
44+
- name: Get short SHA
45+
id: vars
46+
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
47+
run: |
48+
cd "$GITHUB_WORKSPACE"
49+
git config --global --add safe.directory "$(pwd)"
50+
SHORT_SHA=$(git rev-parse --short HEAD)
51+
echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
52+
echo "Captured SHA: $SHORT_SHA"
53+
54+
- name: Package executable with dependencies
55+
shell: C:\cygwin\bin\bash.exe --login -o igncr '{0}'
56+
run: |
57+
cd "$GITHUB_WORKSPACE"
58+
mkdir -p release
59+
cp pcoul.exe release/
60+
cp /cygdrive/c/cygwin/bin/cygwin1.dll release/
61+
cp /cygdrive/c/cygwin/bin/cyggmp-10.dll release/
62+
cp /cygdrive/c/cygwin/bin/cyggcc_s-seh-1.dll release/
63+
cd release
64+
7z a ../pcoul-windows7-${{ steps.vars.outputs.short_sha }}.zip *
65+
66+
# Option 1: Upload as workflow artifact (downloadable for 90 days)
67+
# Set to 'false' to disable
68+
- name: Upload artifact
69+
if: true
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: pcoul-windows7-${{ steps.vars.outputs.short_sha }}
73+
path: pcoul-windows7-${{ steps.vars.outputs.short_sha }}.zip
74+
retention-days: 90
75+
76+
# Option 2: Create or update draft release
77+
# Set to 'true' to enable
78+
- name: Create or update draft release
79+
if: false
80+
uses: softprops/action-gh-release@v1
81+
with:
82+
tag_name: latest-windows
83+
name: "Windows Build (Windows 7)"
84+
draft: true
85+
prerelease: false
86+
files: pcoul-windows7-${{ steps.vars.outputs.short_sha }}.zip
87+
body: |
88+
Automated Windows 7 build of pcoul
89+
90+
Built from commit: ${{ github.sha }}
91+
Short SHA: ${{ steps.vars.outputs.short_sha }}
92+
93+
This archive contains:
94+
- pcoul.exe
95+
- cygwin1.dll
96+
- cyggmp-10.dll
97+
- cyggcc_s-seh-1.dll
98+
99+
Extract all files to the same directory before running pcoul.exe.
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)