From 2ef3bbb04397d5c79a5aa1af8de554978a6733f5 Mon Sep 17 00:00:00 2001 From: Valentin Zulkower Date: Mon, 18 Nov 2024 15:13:39 -0500 Subject: [PATCH] more github workflow fixing --- .github/workflows/publish.yml | 27 +++++++++++++++++---- .github/workflows/publish_job.yml | 32 ------------------------- .github/workflows/release-on-tags.yml | 2 +- .github/workflows/test.yml | 23 +++++++++++++++--- .github/workflows/test_job.yml | 34 --------------------------- 5 files changed, 44 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/publish_job.yml delete mode 100644 .github/workflows/test_job.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e7d3ef9..c40d7e9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,8 @@ -name: Publish to PyPI module +name: Publish to PyPI on: release: - types: [created] + types: [published] workflow_dispatch: inputs: @@ -10,5 +10,24 @@ permissions: contents: read jobs: - publish: - uses: ./.github/workflows/publish_job.yml \ No newline at end of file + deploy: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: pyproject.toml + - name: Install dependencies + run: | + pip install setuptools wheel build + - name: Build + run: | + python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/publish_job.yml b/.github/workflows/publish_job.yml deleted file mode 100644 index 45ff7a6..0000000 --- a/.github/workflows/publish_job.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish to PyPI module - - -on: - workflow_call: - -permissions: - contents: read - -jobs: - deploy: - runs-on: ubuntu-latest - needs: [test] - environment: release - permissions: - id-token: write - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: pip - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - pip install setuptools wheel build - - name: Build - run: | - python -m build - - name: Publish - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release-on-tags.yml b/.github/workflows/release-on-tags.yml index e6e17b9..f788d2e 100644 --- a/.github/workflows/release-on-tags.yml +++ b/.github/workflows/release-on-tags.yml @@ -1,4 +1,4 @@ -name: Release and publish on Tag +name: Release on tag on: push: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1529c78..c305431 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,23 @@ permissions: jobs: test: - uses: ./.github/workflows/test_job.yml - secrets: - GINKGOAI_API_KEY: ${{ secrets.GINKGOAI_API_KEY }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + - name: Install dependencies + run: | + pip install '.[test]' + - name: Run tests + env: + GINKGOAI_API_KEY: ${{ secrets.GINKGOAI_API_KEY }} + run: | + pytest \ No newline at end of file diff --git a/.github/workflows/test_job.yml b/.github/workflows/test_job.yml deleted file mode 100644 index 6733c3b..0000000 --- a/.github/workflows/test_job.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Test module - -on: - workflow_call: - secrets: - GINKGOAI_API_KEY: - description: "Key for GinkgoAI API" - required: true - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.12"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - pip install '.[test]' - - name: Run tests - env: - GINKGOAI_API_KEY: ${{ secrets.GINKGOAI_API_KEY }} - run: | - pytest \ No newline at end of file