From 38d5f1b8f798ced2e442762e187272139957c7ad Mon Sep 17 00:00:00 2001 From: David Ochoa Date: Sat, 2 Dec 2023 17:16:57 +0000 Subject: [PATCH] fix: adjust workflow --- .github/workflows/docs.yaml | 35 ---------------------------- .github/workflows/pytest.yaml | 2 +- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml deleted file mode 100644 index 7ee43e1d7..000000000 --- a/.github/workflows/docs.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: docs -on: - push: - branches: - - main -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.10.8 - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root - - name: Install library - run: poetry install --without tests --no-interaction - - name: Publish docs - run: poetry run mkdocs gh-deploy --force diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index d16b945e5..11303e085 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -1,7 +1,7 @@ name: tests on: [push] jobs: - test: + Test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 39f42ae41..94e7426c4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,12 +1,44 @@ -name: Semantic Release +name: Release and Documentation on: push: branches: - - master + - main jobs: - release: + Documentation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10.8 + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + - name: Install library + run: poetry install --without tests --no-interaction + - name: Publish docs + run: poetry run mkdocs gh-deploy --force + + Release: + needs: Documentation + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') runs-on: ubuntu-latest concurrency: release permissions: @@ -33,8 +65,8 @@ jobs: - name: Python Semantic Release run: | git config --global user.name "github-actions" - git config --global user.email "action@github.com" - semantic-release publish -D commit_author="github-actions " + git config --global user.email "github-actions@github.com" + semantic-release publish -D commit_author="github-actions " env: GH_TOKEN: ${{secrets.OTG_ETL_RELEASE}} # PyPI_TOKEN: ${{secrets.PyPI_TOKEN}}