Build Windows Installer #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License 2.0 (the "License"). You may not use | |
# this file except in compliance with the License. You can obtain a copy | |
# in the file LICENSE in the source distribution or at | |
# https://www.openssl.org/source/license.html | |
name: Build Windows Installer | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
type: string | |
description: The tag to build | |
permissions: | |
contents: read | |
jobs: | |
build_installer: | |
runs-on: windows-2022 | |
steps: | |
- name: Setup environment | |
run: | | |
if [ "${{ github.event.inputs.tag }}" == "" ]; then "echo TGT_REV=$(git rev-parse HEAD)" >> $GITHUB_ENV; else "echo TGT_REV=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | |
- name: Compute installer version | |
run: | | |
echo $TGT_REV | grep -q "openssl-[0-9]\+\.[0-9]\+\.[0-9]\+" | |
if [ $? -ne 0 ]; then "echo TGT_VER=$TGT_REV" >> $GITHUB_ENV; else echo "TGT_VER=$(echo $TGT_REV | sed -e's/\.[0-9]\+$//')" >> $GITHUB_ENV; fi | |
- uses: actions/checkout@v4 | |
with: | |
ref: $TGT_REV | |
path: 'openssl' | |
- name: Setup directories | |
run: | | |
mkdir _installer | |
mkdir openssl/_build64 | |
mkdir openssl_build32 | |
- name: download NSIS installer | |
uses: suisei-cn/actions-download-file@v1.6.0 | |
with: | |
url: "https://downloads.sourceforge.net/project/nsis/NSIS%203/3.08/nsis-3.08-setup.exe" | |
target: _installer/ | |
- name: Install NSIS 3.0.8 | |
working-directory: _installer | |
run: .\nsis-3.08-setup.exe /s | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: win64 | |
- uses: ilammy/setup-nasm@v1 | |
with: | |
platform: win64 | |
- name: config x64 | |
working-directory: openssl/_build64 | |
run: | | |
perl ..\Configure --banner=Configured no-makedepend enable-fips VC-WIN64A | |
perl configdata.pm --dump | |
- name: build x64 binaries | |
working-directory: _build64 | |
run: nmake /S | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: win32 | |
- uses: ilammy/setup-nasm@v1 | |
with: | |
platform: win32 | |
- name: config x32 | |
working-directory: openssl/_build32 | |
run: | | |
perl ..\Configure --banner=Configured no-makedepend enable-fips VC-WIN32 | |
perl configdata.pm --dump | |
- name: build x32 binaries | |
working-directory: _build32 | |
run: nmake /S | |
- name: build installer | |
working-directory: openssl/windows-installer | |
run: makensis.exe /DVERSION=${{ github.event.inputs.tag }} /DBUILD32=_build32 /DBUILD64=_build64 .\openssl.nsi | |
- name: Upload installer as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openssl-installer | |
path: windows-installer/openssl*.exe | |