Skip to content

Commit

Permalink
Windows vcredist (#12)
Browse files Browse the repository at this point in the history
* copy vcruntime140.dll

* support publishing prereleases

* reenable
  • Loading branch information
bjia56 authored Jan 25, 2024
1 parent ec67a18 commit 79d192c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ on:
python_version:
required: true
type: string
beta:
required: false
type: boolean
default: false
workflow_call:
inputs:
python_version:
required: true
type: string
beta:
required: false
type: boolean
default: false

jobs:
build:
Expand Down Expand Up @@ -40,11 +48,12 @@ jobs:

- name: Pick tag
run: |
echo "SELECTED_TAG=$(./scripts/pick_semver.sh ${{ inputs.python_version }})" >> $GITHUB_ENV
echo "SELECTED_TAG=$(./scripts/pick_semver.sh ${{ inputs.python_version }} ${{ inputs.beta }})" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: /tmp/python/python*.zip
tag_name: ${{ env.SELECTED_TAG }}
body: "Python ${{ inputs.python_version }}"
prerelease: ${{ inputs.beta }}
3 changes: 3 additions & 0 deletions scripts/build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ cd ${WORKDIR}
# Need to bundle openssl with the executable
cp deps/openssl/bin/*.dll python-install/bin

# Need to bundle vcredist
cp /c/WINDOWS/SYSTEM32/VCRUNTIME140.dll python-install/bin

echo "::endgroup::"
###############
# Test python #
Expand Down
15 changes: 11 additions & 4 deletions scripts/pick_semver.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
#!/bin/bash

python_version=$1
beta=$2

tags=$(git tag | grep $python_version)

suffix=build
if [[ "$beta" == "true" ]]; then
suffix=beta
fi

tags=$(git tag | grep "$python_version-$suffix")

if [[ -z "$tags" ]]; then
echo "v$python_version-build.0"
echo "v$python_version-$suffix.0"
exit 0
fi

most_recent=0
while read tag; do
tag_postfix=$(echo $tag | sed "s/^v$python_version-build\.//")
tag_postfix=$(echo $tag | sed "s/^v$python_version-$suffix\.//")
if [ "$tag_postfix" -gt "$most_recent" ]; then
most_recent=$tag_postfix
fi
done <<< "$tags"

echo "v$python_version-build.$(expr $most_recent + 1)"
echo "v$python_version-$suffix.$(expr $most_recent + 1)"

0 comments on commit 79d192c

Please sign in to comment.