-
Notifications
You must be signed in to change notification settings - Fork 4
149 lines (128 loc) · 5.13 KB
/
make_installer.yml
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
name: Make installer
on:
workflow_dispatch:
push:
release:
types: [published]
env:
GCC_DOWNLOAD: "https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-14.0.6-10.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-12.2.0-mingw-w64msvcrt-10.0.0-r2.zip"
GCC_DIGEST: "06be414c7d2e4b91bcfd089d693d942d824e686d244a25709e72a78d30b82ea4"
GIT_DOWNLOAD: "https://github.com/git-for-windows/git/releases/download/v2.35.2.windows.1/MinGit-2.35.2-64-bit.zip"
GIT_DIGEST: "61f0f2d9abd7d54fbb81b30519d4aad8be66268e67cfc9d47871010d340821c5"
ENVAR_DOWNLOAD: "https://github.com/GsNSIS/EnVar/releases/download/v0.3.1/EnVar-Plugin.zip"
ENVAR_DIGEST: "e5b337fcad68252d18282f7259a0306053626e41b9480fa09df3fab012b85e00"
jobs:
make_installer:
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup MinGW (MSYS2)
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
wget
unzip
mingw-w64-x86_64-openblas
- name: Fetch Mingw-w64
shell: msys2 {0}
run: |
wget $GCC_DOWNLOAD -O mingw-w64.zip
echo $GCC_DIGEST mingw-w64.zip | sha256sum --check
unzip mingw-w64.zip
- name: Add Mingw-w64 to path to build fpm
run: echo "$pwd\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Checkout fpm code
uses: actions/checkout@v2
with:
repository: fortran-lang/fpm
ref: v0.8.2
path: fpm-src
- name: Install fpm for bootstrapping
uses: fortran-lang/setup-fpm@v3
with:
fpm-version: 'v0.8.0'
- name: Build fpm from source with OpenMP
run: |
mkdir fpm
gfortran --version
fpm run -C fpm-src --profile release --flag "-fopenmp --static" --runner copy -- ..\fpm\
- name: Remove fpm src
shell: msys2 {0}
run: rm -rf fpm-src
- name: Fetch Git for Windows
shell: msys2 {0}
run: |
wget $GIT_DOWNLOAD -O MinGit.zip
echo $GIT_DIGEST MinGit.zip | sha256sum --check
unzip MinGit.zip -d MinGit
- name: Fetch EnVar Plugin for NSIS
shell: msys2 {0}
run: |
wget $ENVAR_DOWNLOAD -O EnVar-Plugin.zip
echo $ENVAR_DIGEST EnVar-Plugin.zip | sha256sum --check
mkdir -p nsis-plugins/EnVar_plugin
unzip EnVar-Plugin.zip -d nsis-plugins/EnVar_plugin
- name: Fetch OpenBLAS
shell: msys2 {0}
run: |
mkdir OpenBLAS
cp /mingw64/bin/libopenblas.dll ./mingw64/bin/
cp -r /mingw64/include/OpenBLAS ./mingw64/include
cp -r /mingw64/lib/libopenblas.* ./mingw64/lib/
cp ./mingw64/lib/libopenblas.a ./mingw64/lib/libblas.a
cp ./mingw64/lib/libopenblas.a ./mingw64/lib/liblapack.a
cp ./mingw64/lib/libopenblas.dll.a ./mingw64/lib/libblas.dll.a
cp ./mingw64/lib/libopenblas.dll.a ./mingw64/lib/liblapack.dll.a
mkdir ./mingw64/share/licenses
cp -r /mingw64/share/licenses/OpenBLAS ./mingw64/share/licenses/
- name: Generate installer
run: makensis quickstart-fortran-installer.nsi
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: quickstart-fortran-installer
path: quickstart-fortran-installer.exe
- name: Upload to release
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: quickstart-fortran-installer.exe
tag: ${{ github.ref }}
overwrite: true
test_installer:
runs-on: windows-2022
needs:
- make_installer
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: quickstart-fortran-installer
path: ${{ github.workspace }} # This will download all files
- name: Remove existing Git installations from PATH
shell: cmd
run: |
mv "C:\Program Files\Git\bin\git.exe" "C:\Program Files\Git\bin\git-old.exe"
mv "C:\Program Files\Git\cmd\git.exe" "C:\Program Files\Git\cmd\git-old.exe"
mv "C:\Program Files\Git\mingw64\bin\git.exe" "C:\Program Files\Git\mingw64\bin\git-old.exe"
- name: Run Quickstart-Fortran installer
shell: cmd
run: .\quickstart-fortran-installer.exe /S
- name: Update path manually
run: |
echo "$env:LOCALAPPDATA\quickstart_fortran\fpm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
echo "$env:LOCALAPPDATA\quickstart_fortran\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$env:LOCALAPPDATA\quickstart_fortran\MinGit\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$env:LOCALAPPDATA\quickstart_fortran\utils" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check installation
shell: cmd
run: |
where fpm
where git
fpm --version
git --version
setup-stdlib