Skip to content

Commit

Permalink
Merge pull request #24 from sqlitecloud/#release-and-publish
Browse files Browse the repository at this point in the history
refact(github-actions): bump and tag release before publishing
  • Loading branch information
danielebriggi committed Aug 6, 2024
2 parents b0b3461 + 3ccd6ee commit ec29aeb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
name: Publish SqliteCloud 🐍 to PyPI 📦
name: Publish SQLite Cloud to PyPI

on:
workflow_dispatch:

jobs:
release:
if: ${{ github.ref == 'refs/heads/main' }}
name: Bump version and tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Set version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
python -m pip install -r requirements-dev.txt
bump2version patch
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true
tags: true

build-n-publish:
name: Build and publish SqliteCloud 🐍 to PyPI 📦
if: ${{ github.ref == 'refs/heads/main' }}
name: Build and publish SQLite Cloud to PyPI
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -35,7 +58,7 @@ jobs:
echo "Current Directory: $(pwd)"
rm -r src/sqlitecloud.egg-info
ls src/
- name: Publish distribution 📦 to PyPI
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: src/dist/
Expand Down
23 changes: 1 addition & 22 deletions .github/workflows/deploy.yaml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Test and Release
name: Test

on:
push:
Expand Down Expand Up @@ -44,24 +44,3 @@ jobs:
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: tests
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Set version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
python -m pip install -r requirements-dev.txt
bump2version patch
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true
tags: true

0 comments on commit ec29aeb

Please sign in to comment.