Skip to content

Commit 3ccd6ee

Browse files
committed
refact(github-actions): bump and tag release before publishing
1 parent b0b3461 commit 3ccd6ee

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

.github/workflows/pypi-release.yaml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
name: Publish SqliteCloud 🐍 to PyPI 📦
1+
name: Publish SQLite Cloud to PyPI
22

33
on:
44
workflow_dispatch:
55

66
jobs:
7+
release:
8+
if: ${{ github.ref == 'refs/heads/main' }}
9+
name: Bump version and tag
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v4
14+
- name: Set version
15+
run: |
16+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
17+
git config --local user.name "github-actions[bot]"
18+
python -m pip install -r requirements-dev.txt
19+
bump2version patch
20+
- name: Push changes
21+
uses: ad-m/github-push-action@master
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
branch: ${{ github.ref }}
25+
force: true
26+
tags: true
27+
728
build-n-publish:
8-
name: Build and publish SqliteCloud 🐍 to PyPI 📦
29+
if: ${{ github.ref == 'refs/heads/main' }}
30+
name: Build and publish SQLite Cloud to PyPI
31+
needs: release
932
runs-on: ubuntu-latest
1033
steps:
1134
- uses: actions/checkout@master
@@ -35,7 +58,7 @@ jobs:
3558
echo "Current Directory: $(pwd)"
3659
rm -r src/sqlitecloud.egg-info
3760
ls src/
38-
- name: Publish distribution 📦 to PyPI
61+
- name: Publish distribution to PyPI
3962
uses: pypa/gh-action-pypi-publish@release/v1
4063
with:
4164
packages-dir: src/dist/

.github/workflows/deploy.yaml renamed to .github/workflows/test.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33

4-
name: Test and Release
4+
name: Test
55

66
on:
77
push:
@@ -44,24 +44,3 @@ jobs:
4444
uses: codecov/codecov-action@v4.0.1
4545
with:
4646
token: ${{ secrets.CODECOV_TOKEN }}
47-
release:
48-
if: ${{ github.ref == 'refs/heads/main' }}
49-
needs: tests
50-
name: Release
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v4
54-
- uses: actions/setup-python@v4
55-
- name: Set version
56-
run: |
57-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
58-
git config --local user.name "github-actions[bot]"
59-
python -m pip install -r requirements-dev.txt
60-
bump2version patch
61-
- name: Push changes
62-
uses: ad-m/github-push-action@master
63-
with:
64-
github_token: ${{ secrets.GITHUB_TOKEN }}
65-
branch: ${{ github.ref }}
66-
force: true
67-
tags: true

0 commit comments

Comments
 (0)