diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f1a4bda0..42f6972d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,30 +11,34 @@ on: branches: - main +permissions: {} + jobs: check: - + permissions: + contents: read runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: submodules: 'recursive' + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 id: setup-python with: python-version: ${{ matrix.python-version }} - name: Install uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 with: enable-cache: true - - uses: actions/cache@v4 + - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 name: Define a cache for the virtual environment based on the dependencies lock file id: cache with: diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml index c8a7623d..7ef37a9a 100644 --- a/.github/workflows/features.yml +++ b/.github/workflows/features.yml @@ -6,8 +6,12 @@ on: branches: - main +permissions: {} + jobs: build: + permissions: + contents: read uses: ably/features/.github/workflows/sdk-features.yml@main with: repository-name: ably-python diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90e54327..d1027713 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,25 +6,30 @@ on: branches: - main +permissions: {} + jobs: lint: + permissions: + contents: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: submodules: 'recursive' + persist-credentials: false - name: Set up Python 3.9 - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 id: setup-python with: python-version: '3.9' - name: Install uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 with: enable-cache: true - - uses: actions/cache@v4 + - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 name: Define a cache for the virtual environment based on the dependencies lock file id: cache with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23326f8c..8f47e6b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,32 +6,30 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' +permissions: {} + jobs: build: name: Build distribution 📦 runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: submodules: 'recursive' + persist-credentials: false - name: Set up Python 3.12 - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 id: setup-python with: python-version: 3.12 - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - - uses: actions/cache@v4 - name: Define a cache for the virtual environment based on the dependencies lock file - id: cache + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 with: - path: ./.venv - key: venv-${{ runner.os }}-3.12-${{ hashFiles('uv.lock') }} + enable-cache: false - name: Install dependencies run: uv sync --extra crypto --extra dev @@ -40,7 +38,7 @@ jobs: - name: Build a binary wheel and a source tarball run: uv build - name: Store the distribution packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: python-package-distributions path: dist/ @@ -82,7 +80,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: python-package-distributions path: dist/ @@ -110,7 +108,7 @@ jobs: TAG: ${{ steps.tag.outputs.tag }} - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 publish-to-testpypi: name: Publish Python distribution to TestPyPI @@ -127,11 +125,11 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: python-package-distributions path: dist/ - name: Publish distribution 📦 to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 with: repository-url: https://test.pypi.org/legacy/