Skip to content

Commit

Permalink
ci: update run commands and use PR to deploy release
Browse files Browse the repository at this point in the history
  • Loading branch information
merylldindin committed Jul 5, 2024
1 parent ad673c2 commit 4eea05f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,41 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup poetry
run: curl -sSL https://install.python-poetry.org | python3 -
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Checkout new release branch
run: |
git checkout -b gh/release-${{ inputs.version }}
- name: Update version in `pyproject.toml`
run: poetry version ${{ inputs.version }}
run: |
poetry version ${{ inputs.version }}
- name: Commit version bump
run: |
git config --local user.name "github[bot]"
git config --local user.email "github[bot]@github.com"
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add pyproject.toml
git commit -m "build: bump version to ${{ inputs.version }}"
git push origin master
- name: Push changes to release branch
run: |
git push origin gh/release-${{ inputs.version }}
- name: Create release
run: gh release create ${{ inputs.version }} --title ${{ inputs.version }} --notes "Release ${{ inputs.version }}"
run: |
gh release create ${{ inputs.version }} --title ${{ inputs.version }} --notes "Release ${{ inputs.version }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to PyPI
run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
- name: Create pull request
run: |
gh pr create --title "build: release `${{ inputs.version }}`" --body "Release ${{ inputs.version }}" --base master --head gh/release-${{ inputs.version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 12 additions & 6 deletions .github/workflows/sirtuin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ jobs:
key: sirtuin-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Setup poetry
run: curl -sSL https://install.python-poetry.org | python3 -
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: poetry install --sync --with dev
run: |
poetry install --sync --with dev
- name: Run `black`
run: make black
run: |
make black
- name: Run `mypy`
run: make mypy
run: |
make mypy
- name: Run `ruff`
run: make ruff
run: |
make ruff
- name: Run `pytest`
run: make pytest
run: |
make pytest

0 comments on commit 4eea05f

Please sign in to comment.