├── README.md └── .github └── workflows └── build.yml /README.md: -------------------------------------------------------------------------------- 1 | # openssl-build 2 | OpenSSL Builds 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build & Upload 2 | 3 | permissions: 4 | contents: write 5 | 6 | # Controls when the action will run. 7 | on: 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | jobs: 12 | release: 13 | name: "Build and upload artifacts" 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | matrix: 17 | os: 18 | - ubuntu-latest 19 | - macos-13 20 | - windows-latest 21 | steps: 22 | # Cancel other actions of the same type that might be already running 23 | - name: "Cancel similar actions in progress" 24 | uses: styfle/cancel-workflow-action@0.9.1 25 | with: 26 | access_token: ${{ github.token }} 27 | 28 | # Detects OS and provide Nim-friendly OS identifiers 29 | - name: Detect current OS 30 | id: os 31 | run: echo "os=${{matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'macos-13' && 'macosx' || matrix.os == 'windows-latest' && 'windows'}}" >> $GITHUB_OUTPUT 32 | 33 | # Get latest OpenSSL release 34 | - id: release 35 | uses: pozetroninc/github-action-get-latest-release@master 36 | with: 37 | owner: openssl 38 | repo: openssl 39 | token: ${{ secrets.GITHUB_TOKEN }} 40 | excludes: prerelease, draft 41 | 42 | # Checks out the repository 43 | - uses: actions/checkout@v4 44 | with: 45 | repository: openssl/openssl 46 | ref: ${{ steps.release.outputs.release }} 47 | 48 | # Installs libraries 49 | - name: install musl-gcc 50 | run: sudo apt-get install -y musl-tools 51 | if: matrix.os == 'ubuntu-latest' 52 | 53 | - name: Setup Msys2 54 | if: matrix.os == 'windows-latest' 55 | uses: msys2/setup-msys2@v2 56 | with: 57 | msystem: MINGW64 58 | release: true 59 | update: true 60 | install: >- 61 | base-devel 62 | autotools 63 | perl 64 | mingw-w64-x86_64-perl-locale-maketext 65 | mingw-w64-x86_64-toolchain 66 | mingw-w64-x86_64-autotools 67 | 68 | - name: Run MSYS2 once 69 | shell: msys2 {0} 70 | run: | 71 | pwd 72 | echo $MSYSTEM 73 | echo $MSYS2_PATH_TYPE 74 | echo $PATH 75 | if: matrix.os == 'windows-latest' 76 | 77 | # Configure (windows) 78 | - name: Configure 79 | shell: msys2 {0} 80 | run: export PATH=/usr/bin:$PATH && ./Configure mingw64 no-asm no-shared no-async 81 | if: matrix.os == 'windows-latest' 82 | 83 | # Configure (macos) 84 | - name: Configure 85 | shell: bash 86 | run: CC=clang && ./Configure no-asm no-shared no-async 87 | if: matrix.os == 'macos-13' 88 | 89 | # Configure (linux) 90 | - name: Configure 91 | shell: bash 92 | run: CC="musl-gcc -fPIE -pie -static -idirafter /usr/include/ -idirafter /usr/include/x86_64-linux-gnu/" ./Configure no-asm no-shared no-async 93 | if: matrix.os == 'ubuntu-latest' 94 | 95 | # Make (windows) 96 | - name: Make 97 | shell: msys2 {0} 98 | run: export PATH=/usr/bin:$PATH && make 99 | if: matrix.os == 'windows-latest' 100 | 101 | # Make (linux/macos) 102 | - name: Make 103 | shell: bash 104 | run: make 105 | if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' 106 | 107 | # Package the resulting Linux/macOS binary 108 | - name: Create artifact (Linux, macOS) 109 | run: zip ${{steps.release.outputs.release}}_${{steps.os.outputs.os}}_x64.zip *.a 110 | if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' 111 | 112 | # Package the resulting Windows binary 113 | - name: Create artifact (Windows) 114 | run: Compress-Archive -Path *.a -DestinationPath ${{steps.release.outputs.release}}_windows_x64.zip 115 | if: matrix.os == 'windows-latest' 116 | 117 | # Upload artifacts to current draft release 118 | - name: "Upload to current release" 119 | uses: xresloader/upload-to-github-release@v1 120 | env: 121 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 122 | with: 123 | file: "openssl*.zip" 124 | overwrite: true 125 | tag_name: ${{steps.release.outputs.release}} 126 | update_latest_release: true 127 | verbose: true 128 | --------------------------------------------------------------------------------