Skip to content

Commit

Permalink
Ensure go.mod is updated before building Python packages in GitHub Wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
pydsigner committed Oct 30, 2023
1 parent 0474a31 commit f07d1be
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux_2_28_i686
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64
CIBW_BEFORE_ALL: .ci/ensure-go.sh; cd bindings/py; go build -buildmode=c-shared -o src/minify/_minify.so
CIBW_BEFORE_ALL: .ci/ensure-go.sh; cd bindings/py; go get github.com/tdewolff/minify/v2@${GITHUB_REF#refs/tags/}; go build -buildmode=c-shared -o src/minify/_minify.so

- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -64,15 +64,9 @@ jobs:
with:
go-version: '>=1.17'
- name: Fetch go package
if: startsWith(github.ref, 'refs/tags/')
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@${GITHUB_REF#refs/tags/}
- name: Fetch go package
if: startsWith(github.ref, 'refs/tags/') == false
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@$(git describe --tags --abbrev=0)
- name: Prebuild windows extension
run: |
sudo apt-get install mingw-w64
Expand All @@ -99,6 +93,13 @@ jobs:
# cibw_target: ARM64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '>=1.17'
- name: Update version in go.mod
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@${GITHUB_REF#refs/tags/}
- uses: actions/download-artifact@v3
with:
name: minify-windows-${{ matrix.go_target }}.so
Expand Down Expand Up @@ -137,15 +138,9 @@ jobs:
with:
go-version: '>=1.17'
- name: Fetch go package
if: startsWith(github.ref, 'refs/tags/')
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@${GITHUB_REF#refs/tags/}
- name: Fetch go package
if: startsWith(github.ref, 'refs/tags/') == false
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@$(git describe --tags --abbrev=0)
- name: Prebuild macos extension
run: |
cd bindings/py
Expand Down Expand Up @@ -174,6 +169,13 @@ jobs:
# cibw_target: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '>=1.17'
- name: Update version in go.mod
run: |
cd bindings/py
go get github.com/tdewolff/minify/v2@${GITHUB_REF#refs/tags/}
- uses: actions/download-artifact@v3
with:
name: minify-darwin-${{ matrix.go_target }}.so
Expand Down

0 comments on commit f07d1be

Please sign in to comment.