Skip to content

Commit

Permalink
🔍 Check for windows as well in BUILD_STATIC
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Jul 1, 2024
1 parent 33bb909 commit 0478067
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
Expand All @@ -44,7 +44,7 @@ jobs:
name: amd64-windows
runs-on: windows-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22.2'
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Install MinGW compiler(s)
run: choco install mingw

- uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
- uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand All @@ -76,8 +76,8 @@ jobs:
name: amd64-manylinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -107,12 +107,12 @@ jobs:
name: arm64-manylinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: all

- uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
- uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -142,13 +142,13 @@ jobs:
name: s390x-manylinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: all

- name: Build binary distribution (wheel) on Linux (s390x)
uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -178,13 +178,13 @@ jobs:
name: ppc64le-manylinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: all

- name: Build binary distribution (wheel) on Linux (ppc64le)
uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -214,14 +214,14 @@ jobs:
name: amd64-macos
runs-on: macos-13
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22.2'
cache: false
check-latest: true

- uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
- uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand All @@ -242,14 +242,14 @@ jobs:
name: arm64-macos
runs-on: macos-14
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22.2'
cache: false
check-latest: true

- uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
- uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
path: upload/
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
if: github.event_name == 'release' && github.event.action == 'published'
with:
# Comment this line out to publish to PyPI
Expand All @@ -310,7 +310,7 @@ jobs:
./upload/*.tar.gz
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
if: github.event_name == 'release' && github.event.action == 'published'
with:
# This will contain not only the wheel and sdist, but also the signature files
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: macos-14

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
name: linux-aarch64-buildjet-python-3.12
runs-on: buildjet-2vcpu-ubuntu-2204-arm
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: buildjet/setup-python@v5
- uses: buildjet/setup-go@af85c03c2736c2267d5afe4d5952023a3b64bf89 # v5.0.0
with:
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- python-version: "3.13"
runs-on: windows-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'arm64'
# We need to use cibuildwheel because it has experimental support for cross-compiling
# to arm64 and setup-python does not have arm64 support on Windows right now
uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand All @@ -202,7 +202,7 @@ jobs:
# do not need to do that manually unless we use setup-python instead.
- name: Build binary distribution (wheel) on Windows (i686)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'i686'
uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
with:
package-dir: .
output-dir: wheelhouse
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
name: inspect-sdist-wheel-contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.5"
rev: "v0.4.10"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -27,7 +27,7 @@ repos:
types_or: [python, pyi]

- repo: https://github.com/asottile/pyupgrade
rev: "v3.15.2"
rev: "v3.16.0"
hooks:
- id: pyupgrade

Expand Down
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# ------ Hugo build configuration and constants ------------------------------------

HUGO_VERSION = "0.126.3"
HUGO_VERSION = "0.128.0"
# The Go toolchain will download the tarball into the hugo_cache/ directory.
# We will point the build command to that location to build Hugo from source
HUGO_CACHE_DIR = "hugo_cache"
Expand Down Expand Up @@ -196,10 +196,12 @@ def run(self):

# Build a static binary on Windows to avoid missing DLLs from MinGW,
# i.e., libgcc_s_seh-1.dll, libstdc++-6.dll, etc.
BUILD_STATIC = "linux-musl" in os.environ.get(
"CC", ""
) or "linux-musl" in os.environ.get("CXX", "")

BUILD_STATIC = (
os.environ.get("GOOS") == "windows"
or sys.platform == "win32"
or "linux-musl" in os.environ.get("CC", "")
or "linux-musl" in os.environ.get("CXX", "")
)
if BUILD_STATIC:
ldflags.append("-extldflags '-static'")

Expand Down

0 comments on commit 0478067

Please sign in to comment.