diff --git a/.github/workflows/continuous-deployment.yaml b/.github/workflows/continuous-deployment.yaml deleted file mode 100644 index e476eb0..0000000 --- a/.github/workflows/continuous-deployment.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: CD - -on: - release: - types: [published] - -jobs: - deploy: - name: "Deploy to PyPi server" - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.12 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r dev-requirements.txt - - name: Publish package to TestPyPI - run: bash deploy.sh - env: - PYPI_USER: ${{ secrets.POLLINATION_PYPI_PASSWORD }} - PYPI_PASSWORD: ${{ secrets.POLLINATION_PYPI_PASSWORD }} diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 915e51c..4bcb8a2 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -21,18 +21,24 @@ jobs: - name: Test with pytest run: | python -m pytest + deploy: name: "Semantic Release" needs: test - if: success() && github.ref == 'refs/heads/master' && github.base_ref == '' + if: success() && github.ref == 'refs/heads/master' && github.base_ref == '' && github.repository_owner == 'pollination' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: set up node uses: actions/setup-node@v4 with: node-version: 22.2.0 + - name: install semantic-release + run: + npm install @semantic-release/exec - run: npx semantic-release@^23.1.1 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PYPI_USERNAME: ${{ secrets.POLLINATION_PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.POLLINATION_PYPI_PASSWORD }} diff --git a/.releaserc.json b/.releaserc.json index a966fe6..d9231ed 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -2,6 +2,15 @@ "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", - "@semantic-release/github" + [ + "@semantic-release/github", + { + "successComment": false, + "failTitle": false + } + ], + ["@semantic-release/exec", { + "publishCmd": "bash deploy.sh" + }] ] }