Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ on:
pull_request:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write
issues: write

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.x'

Expand Down Expand Up @@ -56,15 +63,15 @@ jobs:

- name: Publish to Test PyPI
if: steps.version_check.outputs.exists != 'true'
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_TOKEN }}
verbose: true

- name: Comment on PR
if: steps.version_check.outputs.exists != 'true'
uses: actions/github-script@v7
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
env:
VERSION: ${{ env.VERSION }}
with:
Expand Down Expand Up @@ -128,4 +135,4 @@ jobs:
sleep 20
done
echo "success=false" >> $GITHUB_OUTPUT
exit 1
exit 1
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ on:
tags:
- 'v*'

permissions:
contents: read

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.x'

- name: Get Version
id: version
env:
GIT_REF_NAME: ${{ github.ref_name }}
run: |
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)"
if [ "v$RAW_VERSION" != "$GIT_REF_NAME" ]; then
echo "Error: Git tag ($GIT_REF_NAME) does not match package version (v$RAW_VERSION)"
exit 1
fi

Expand All @@ -44,6 +51,6 @@ jobs:

- name: Publish to PyPI
if: steps.version_check.outputs.pypi_exists != 'true'
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
with:
password: ${{ secrets.PYPI_TOKEN }}
password: ${{ secrets.PYPI_TOKEN }}
12 changes: 9 additions & 3 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ on:
- 'setup.py'
- 'pyproject.toml'

permissions:
contents: read
pull-requests: write
issues: write

jobs:
check_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0 # Fetch all history for all branches
persist-credentials: false

- name: Check version increment
id: version_check
Expand Down Expand Up @@ -41,7 +47,7 @@ jobs:
"

- name: Manage PR Comment
uses: actions/github-script@v7
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
if: always()
env:
MAIN_VERSION: ${{ env.MAIN_VERSION }}
Expand Down Expand Up @@ -89,4 +95,4 @@ jobs:
issue_number: prNumber,
body: `❌ **Version Check Failed**\n\nPlease increment...`
});
}
}
3 changes: 3 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
secrets-outside-env:
disable: true
Loading