-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
169 additions
and
26 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: openssl build | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
env: | ||
IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64 | ||
|
||
jobs: | ||
prejob: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
outputs: | ||
tool: ${{ steps.setvar.outputs.envvar }} | ||
steps: | ||
- id: setvar | ||
run: | | ||
echo ${{ secrets._CURRENT_TOOL }} > CI_ENV | ||
echo "::set-output name=envvar::$(sed -e 's/^_//' CI_ENV)" | ||
- run: echo CURRENT_TOOL '${{ steps.setvar.outputs.envvar }}' | ||
|
||
openssl-alpine-musl: | ||
needs: prejob | ||
if: ${{ needs.prejob.outputs.tool=='openssl' }} | ||
runs-on: ubuntu-latest | ||
container: alpine:3.15.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build | ||
id: build | ||
run: | | ||
apk add --no-cache bash | ||
./openssl/build.sh | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: openssl-alpine-musl | ||
path: | | ||
./openssl/release/_musl.tar.gz | ||
openssl-alpine-mingw: | ||
needs: prejob | ||
if: ${{ needs.prejob.outputs.tool=='openssl' }} | ||
runs-on: ubuntu-latest | ||
container: alpine:3.15.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build | ||
id: build | ||
run: | | ||
apk add --no-cache bash | ||
./openssl/build_mingw.sh | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: openssl-alpine-mingw | ||
path: | | ||
./openssl/release/_mingw.tar.gz | ||
openssl-alpine-test: | ||
needs: openssl-alpine-musl | ||
runs-on: ubuntu-latest | ||
container: alpine:3.15.0 | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: openssl-alpine-musl | ||
path: . | ||
|
||
- name: Test musl build on Alpine | ||
run: | | ||
tar -xf ./_musl.tar.gz | ||
./openssl version | ||
openssl-nanoserver-test: | ||
needs: openssl-alpine-mingw | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: openssl-alpine-mingw | ||
path: . | ||
- run: tar -xf .\_mingw.tar.gz | ||
|
||
- name: pull windows container ${{ env.IMAGE_NAME }} | ||
shell: cmd | ||
run: | | ||
docker pull ${{ env.IMAGE_NAME }} | ||
docker images ${{ env.IMAGE_NAME }} | ||
- name: Test mingw build on Nanoserver | ||
shell: cmd | ||
run: > | ||
docker container run --rm -v ${{ github.workspace }}:C:\app ${{ env.IMAGE_NAME }} | ||
C:\app\openssl.exe version | ||
openssl-release: | ||
runs-on: ubuntu-latest | ||
needs: [openssl-alpine-test, openssl-nanoserver-test] | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: openssl-alpine-musl | ||
path: . | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: openssl-alpine-mingw | ||
path: . | ||
- run: | | ||
tar -xf ./_musl.tar.gz | ||
tar -xf ./_mingw.tar.gz | ||
cat _musl.md >> body.md | ||
cat _mingw.md >> body.md | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
tag: 'openssl-1_1_1k' | ||
artifacts: './openssl*' | ||
bodyFile: './body.md' | ||
allowUpdates: true | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
echo "::group::install deps" | ||
|
||
apk update | ||
apk add --no-cache alpine-sdk perl make linux-headers mingw-w64-gcc | ||
|
||
echo "::endgroup::" | ||
|
||
tool_name="openssl.exe" | ||
tool_version="1_1_1k" | ||
echo "::set-output name=tool_name::$tool_name" | ||
echo "::set-output name=tool_version::$tool_version" | ||
|
||
download_url="https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
mkdir -p "$dp0/release" && cd "$dp0/release" | ||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
tar -xf "tool-$tool_version.tar.gz" && cd "openssl-OpenSSL_$tool_version" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
./Configure mingw64 --cross-compile-prefix=x86_64-w64-mingw32- no-shared LDFLAGS='--static' no-makedepend | ||
make | ||
|
||
echo "::endgroup::" | ||
|
||
mkdir "$dp0/release/build" && cd "$dp0/release/build" | ||
cp -f "$dp0/release/openssl-OpenSSL_$tool_version/apps/$tool_name" "$dp0/release/build/" | ||
|
||
{ printf 'SHA-256: %s | ||
%s | ||
' "$(sha256sum $tool_name)" "$download_url" | ||
} > _mingw.md | ||
|
||
cat _mingw.md | ||
|
||
tar -czvf ../_mingw.tar.gz . |