mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-12 19:30:30 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6ded91185 | |||
| eb64874c47 | |||
| b7200852a4 | |||
| 3d18205205 | |||
| 6806de23b3 | |||
| 6a93ab05a3 | |||
|
|
c5b2ab9932 | ||
| 5a32a5908b |
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -19,6 +19,7 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref_name != 'master'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: psf/black@stable
|
||||
@@ -35,6 +36,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
if: github.ref_name != 'master'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
@@ -46,7 +48,7 @@ jobs:
|
||||
|
||||
tag_and_publish:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.head_ref == 'master' || github.head_ref == 'dev'
|
||||
if: github.ref_name == 'dev' || github.ref_name == 'master'
|
||||
needs: test
|
||||
permissions:
|
||||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
||||
@@ -56,7 +58,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
ref: ${{ github.head_ref }}
|
||||
ref: ${{ github.ref_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup git
|
||||
@@ -67,15 +69,11 @@ jobs:
|
||||
- name: set version format
|
||||
id: version_format
|
||||
run: |
|
||||
if [[ ${{ github.head_ref }} == 'master' ]]; then
|
||||
if [[ ${{ github.ref_name }} == 'master' ]]; then
|
||||
echo "version_format=\${major}.\${minor}.\${patch}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "version_format=\${major}.\${minor}.\${patch}rc\${increment}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: print version format
|
||||
run: |
|
||||
echo "Version format: ${{ steps.version_format.outputs.version_format }}"
|
||||
|
||||
- name: Git Version
|
||||
uses: PaulHatch/semantic-version@v5.4.0
|
||||
@@ -88,11 +86,20 @@ jobs:
|
||||
version_format: ${{ steps.version_format.outputs.version_format }}
|
||||
|
||||
- name: Create & Push Tag
|
||||
if: github.head_ref == 'master' || github.head_ref == 'dev'
|
||||
if: github.ref_name == 'master' || github.ref_name == 'dev'
|
||||
run: |
|
||||
git tag ${{ steps.git_version.outputs.version }}
|
||||
git push origin ${{ steps.git_version.outputs.version }}
|
||||
|
||||
- name: Sync tag to dev branch
|
||||
if: github.ref_name == 'master'
|
||||
run: |
|
||||
git fetch origin dev
|
||||
git checkout dev
|
||||
git merge --no-ff ${{ steps.git_version.outputs.version }}
|
||||
git push origin dev
|
||||
git checkout master
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
|
||||
@@ -107,7 +107,7 @@ def paginate(
|
||||
count_query = create_count_query(query)
|
||||
total = connection.scalar(count_query)
|
||||
|
||||
if paginationFlag is False:
|
||||
if paginationFlag is False and total > 0:
|
||||
params = Params(page=1, size=total)
|
||||
|
||||
query = create_paginate_query(query, params)
|
||||
|
||||
Reference in New Issue
Block a user