ci: upgrade OpenSSL on macOS runners before building #334
Workflow file for this run
This file contains hidden or 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
| name: Build / Release | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: macos-15-intel | |
| os: darwin | |
| arch: amd64 | |
| - runner: macos-14 | |
| os: darwin | |
| arch: arm64 | |
| - runner: windows-2022 | |
| os: windows | |
| arch: amd64 | |
| - runner: ubuntu-22.04 | |
| os: linux | |
| arch: amd64 | |
| - runner: ubuntu-22.04-arm | |
| os: linux | |
| arch: arm64 | |
| runs-on: ${{ matrix.runner }} | |
| outputs: | |
| cli_version: ${{ steps.cli_version.outputs.cli_version }} | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: .python-version | |
| # Add a retry to avoid issues when this action is running | |
| # right after the package is published on PyPi | |
| # (and might not be distributed in the CDN yet) | |
| - name: Create virtual environment | |
| uses: nick-fields/retry@v4 | |
| with: | |
| timeout_minutes: 10 | |
| max_attempts: 5 | |
| retry_wait_seconds: 120 | |
| command: make clean-venv venv | |
| env: | |
| # cryptography has no pre-built wheel for macOS x86_64 and builds from | |
| # source via Rust. PKG_CONFIG_PATH (set by setup-python) points to | |
| # Python's own OpenSSL, which can have newer headers than the Homebrew | |
| # libssl.3.dylib that PyInstaller later bundles — causing a | |
| # symbol-not-found crash at runtime. Pinning OPENSSL_DIR to Homebrew | |
| # ensures openssl-sys compiles and links against the exact same dylib | |
| # that PyInstaller will bundle. | |
| OPENSSL_DIR: ${{ matrix.runner == 'macos-15-intel' && '/usr/local/opt/openssl@3' || '' }} | |
| - name: Build using pyinstaller | |
| shell: bash | |
| run: make clean all | |
| - name: Setup Docker on MacOS | |
| # Install docker and start Colima on MacOS (except it's the large runner) | |
| # GitHub xlarge MacOS runner cannot run Docker containers: | |
| # - https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/ | |
| # if: matrix.os == 'darwin' && matrix.runner != 'macos-13-xlarge' | |
| # TODO re-enable when mac11 docker gets more stable | |
| if: ${{ false }} | |
| run: | | |
| brew install docker | |
| colima start | |
| - name: Non-Docker Smoke tests | |
| shell: bash | |
| run: | | |
| # create an extension with default parameters (enter all new lines to use defaults) | |
| printf "\n\n\n\n\n\n\n\n\n" | LOCALSTACK_AUTH_TOKEN=${{ secrets.TEST_LOCALSTACK_AUTH_TOKEN }} DEBUG=1 ./dist-bin/localstack extensions dev new | |
| # print the directory output | |
| ls -al my-localstack-extension | |
| # remove it again | |
| rm -rf my-localstack-extension | |
| - name: Docker Smoke tests (Linux, MacOS) | |
| shell: bash | |
| # GitHub Windows and xlarge MacOS runner cannot run Docker containers: | |
| # - https://github.com/orgs/community/discussions/25491 | |
| # - https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/ | |
| # TODO re-enable for mac when mac11 docker gets more stable | |
| if: matrix.os != 'windows' && matrix.os != 'darwin' | |
| run: | | |
| # Pull images to avoid making smoke tests vulnerable to system behavior (docker pull speed) | |
| docker pull localstack/localstack-pro | |
| cd dist-bin | |
| # start pro with an auth token and extensions dev mode (see issue #20) | |
| LOCALSTACK_AUTH_TOKEN=${{ secrets.TEST_LOCALSTACK_AUTH_TOKEN }} EXTENSION_DEV_MODE=1 ./localstack start -d | |
| ./localstack wait -t 180 | |
| ./localstack logs | grep "extension developer mode enabled" | |
| ./localstack status services --format plain | |
| ./localstack status services --format plain | grep "xray=available" | |
| ./localstack stop | |
| - name: Set CLI version output | |
| id: cli_version | |
| shell: bash | |
| run: | | |
| VERSION_OUTPUT=$(dist-bin/localstack --version) | |
| echo $VERSION_OUTPUT | |
| # using bash parameter expansion to remove the part after the last space, since sed won't work on MacOS | |
| echo "cli_version=${VERSION_OUTPUT##* }" >> $GITHUB_OUTPUT | |
| - name: Archive distribution (Linux, MacOS) | |
| if: matrix.os != 'windows' | |
| run: | | |
| cd dist-bin/ | |
| tar -czf ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }}-onefile.tar.gz localstack | |
| rm localstack | |
| cd ../dist-dir/ | |
| tar -czf ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz localstack | |
| rm -r localstack | |
| - name: Archive distribution (Windows) | |
| if: matrix.os == 'windows' | |
| run: | | |
| cd dist-bin/ | |
| Compress-Archive localstack.exe ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }}-onefile.zip | |
| rm localstack.exe | |
| cd ../dist-dir/ | |
| Compress-Archive localstack ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }}.zip | |
| rm -r localstack | |
| - name: Upload binary artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }}-onefile | |
| path: 'dist-bin/*' | |
| - name: Upload folder artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{github.event.repository.name}}-${{steps.cli_version.outputs.cli_version}}-${{ matrix.os }}-${{ matrix.arch }} | |
| path: 'dist-dir/*' | |
| release: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: | |
| - build | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Builds | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: builds | |
| - name: Generate Checksums | |
| run: | | |
| # move all files from the builds subdirectories to the builds root folder | |
| find ./builds/ -type f -print0 | xargs -0 mv -t ./builds/ | |
| # remove all (empty) subdirectories | |
| find ./builds/ -mindepth 1 -maxdepth 1 -type d -print0 | xargs -r0 rm -R | |
| # generate the checksums | |
| cd builds | |
| sha256sum *.{tar.gz,zip} > ${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-checksums.txt | |
| - name: Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: 'builds/*' | |
| draft: true | |
| token: ${{ secrets.LOCALSTACK_GITHUB_TOKEN }} |