From a40537437d5e396fb7dcdca782a9b337a76d2e08 Mon Sep 17 00:00:00 2001 From: Atticus Zhou <119986792+Atticuszz@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:30:51 +0800 Subject: [PATCH] =?UTF-8?q?Chore=EF=BC=9AUpdate=20ci.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c155e27..69dd907 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,8 @@ on: workflow_dispatch: jobs: - test-and-changelog: - name: Test and Generate Changelog / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} + test: + name: Run Tests / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} strategy: matrix: os: [ ubuntu-latest ] @@ -17,10 +17,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Clone Repository - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} @@ -28,12 +28,6 @@ jobs: uses: abatilo/actions-poetry@v2.4.0 with: poetry-version: 1.7.1 - - - name: Python Semantic Release (Generate Changelog) - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - uses: python-semantic-release/python-semantic-release@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - name: Run Tests run: poetry run tests @@ -41,22 +35,36 @@ jobs: - name: Upload Coverage uses: codecov/codecov-action@v1 - + changelog: + name: Generate Changelog + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + steps: + - name: Clone Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.ATTICUS_PAT }} + + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} publish: - needs: test-and-changelog - if: github.event.pull_request.merged == true + name: Publish to GitHub Releases runs-on: ubuntu-latest - name: "Publish to GitHub Releases" + needs: changelog + if: github.event.pull_request.merged == true steps: - name: Clone Repository - uses: actions/checkout@v3 + uses: actions/checkout@v2 with: - ref: ${{ github.ref }} fetch-depth: 0 token: ${{ secrets.ATTICUS_PAT }} - name: Publish package distributions to GitHub Releases uses: python-semantic-release/upload-to-gh-release@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file