Skip to content

Commit

Permalink
fixed the module name across all workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
flowstate committed Dec 10, 2024
1 parent b281f63 commit 6237a8d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check if version exists in PyPI
id: version_check
run: |
if ! curl -s -f https://pypi.org/pypi/socketsecurity/${{ inputs.version }}/json > /dev/null; then
if ! curl -s -f https://pypi.org/pypi/socketsync/${{ inputs.version }}/json > /dev/null; then
echo "Error: Version ${{ inputs.version }} not found on PyPI"
exit 1
fi
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ jobs:

- name: Set preview version
run: |
BASE_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
BASE_VERSION=$(grep -o "__version__.*" socketsync/__init__.py | awk '{print $3}' | tr -d "'")
PREVIEW_VERSION="${BASE_VERSION}.dev${{ github.event.pull_request.number }}${{ github.event.pull_request.commits }}"
echo "VERSION=${PREVIEW_VERSION}" >> $GITHUB_ENV
# Update version in __init__.py
echo "__version__ = \"${PREVIEW_VERSION}\"" > socketsecurity/__init__.py.tmp
cat socketsecurity/__init__.py | grep -v "__version__" >> socketsecurity/__init__.py.tmp
mv socketsecurity/__init__.py.tmp socketsecurity/__init__.py
echo "__version__ = \"${PREVIEW_VERSION}\"" > socketsync/__init__.py.tmp
cat socketsync/__init__.py | grep -v "__version__" >> socketsync/__init__.py.tmp
mv socketsync/__init__.py.tmp socketsync/__init__.py
# Verify the change
echo "Updated version in __init__.py:"
cat socketsecurity/__init__.py | grep "__version__"
cat socketsync/__init__.py | grep "__version__"
- name: Check if version exists on Test PyPI
id: version_check
env:
VERSION: ${{ env.VERSION }}
run: |
if curl -s -f https://test.pypi.org/pypi/socketsecurity/$VERSION/json > /dev/null; then
if curl -s -f https://test.pypi.org/pypi/socketsync/$VERSION/json > /dev/null; then
echo "Version ${VERSION} already exists on Test PyPI"
echo "exists=true" >> $GITHUB_OUTPUT
else
Expand All @@ -50,9 +50,9 @@ jobs:
if: always()
run: |
BASE_VERSION=$(echo $VERSION | cut -d'.' -f1-3)
echo "__version__ = \"${BASE_VERSION}\"" > socketsecurity/__init__.py.tmp
cat socketsecurity/__init__.py | grep -v "__version__" >> socketsecurity/__init__.py.tmp
mv socketsecurity/__init__.py.tmp socketsecurity/__init__.py
echo "__version__ = \"${BASE_VERSION}\"" > socketsync/__init__.py.tmp
cat socketsync/__init__.py | grep -v "__version__" >> socketsync/__init__.py.tmp
mv socketsync/__init__.py.tmp socketsync/__init__.py
- name: Publish to Test PyPI
if: steps.version_check.outputs.exists != 'true'
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
Install with:
\`\`\`bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==${version}
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsync==${version}
\`\`\`
Docker image: \`socketdev/cli:pr-${prNumber}\`
Expand Down Expand Up @@ -121,9 +121,9 @@ jobs:
VERSION: ${{ env.VERSION }}
run: |
for i in {1..30}; do
if pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==${VERSION}; then
if pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsync==${VERSION}; then
echo "Package ${VERSION} is now available and installable on Test PyPI"
pip uninstall -y socketsecurity
pip uninstall -y socketsync
echo "success=true" >> $GITHUB_OUTPUT
exit 0
fi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Get Version
id: version
run: |
RAW_VERSION=$(python -c "from socketsecurity import __version__; print(__version__)")
RAW_VERSION=$(python -c "from socketsync import __version__; print(__version__)")
echo "VERSION=$RAW_VERSION" >> $GITHUB_ENV
if [ "v$RAW_VERSION" != "${{ github.ref_name }}" ]; then
echo "Error: Git tag (${{ github.ref_name }}) does not match package version (v$RAW_VERSION)"
Expand All @@ -28,7 +28,7 @@ jobs:
env:
VERSION: ${{ env.VERSION }}
run: |
if curl -s -f https://pypi.org/pypi/socketsecurity/$VERSION/json > /dev/null; then
if curl -s -f https://pypi.org/pypi/socketsync/$VERSION/json > /dev/null; then
echo "Version ${VERSION} already exists on PyPI"
echo "pypi_exists=true" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -72,9 +72,9 @@ jobs:
VERSION: ${{ env.VERSION }}
run: |
for i in {1..30}; do
if pip install socketsecurity==${VERSION}; then
if pip install socketsync==${VERSION}; then
echo "Package ${VERSION} is now available and installable on PyPI"
pip uninstall -y socketsecurity
pip uninstall -y socketsync
echo "success=true" >> $GITHUB_OUTPUT
exit 0
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- 'socketsecurity/**'
- 'socketsync/**'
- 'setup.py'
- 'pyproject.toml'

Expand All @@ -19,12 +19,12 @@ jobs:
id: version_check
run: |
# Get version from current PR
PR_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
PR_VERSION=$(grep -o "__version__.*" socketsync/__init__.py | awk '{print $3}' | tr -d "'")
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
# Get version from main branch
git checkout origin/main
MAIN_VERSION=$(grep -o "__version__.*" socketsecurity/__init__.py | awk '{print $3}' | tr -d "'")
MAIN_VERSION=$(grep -o "__version__.*" socketsync/__init__.py | awk '{print $3}' | tr -d "'")
echo "MAIN_VERSION=$MAIN_VERSION" >> $GITHUB_ENV
# Compare versions using Python
Expand Down

0 comments on commit 6237a8d

Please sign in to comment.