Updated ci
This commit is contained in:
34
.gitea/workflows/build.yaml
Normal file
34
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Build on push
|
||||||
|
run-name: Build on push
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare:
|
||||||
|
uses: ./.gitea/workflows/prepare.yaml
|
||||||
|
with:
|
||||||
|
working_directory: src/cpl_core
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
core:
|
||||||
|
needs: prepare
|
||||||
|
uses: ./.gitea/workflows/package.yaml
|
||||||
|
with:
|
||||||
|
working_directory: src/cpl_core
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
query:
|
||||||
|
needs: prepare
|
||||||
|
uses: ./.gitea/workflows/package.yaml
|
||||||
|
with:
|
||||||
|
working_directory: src/cpl_query
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
translation:
|
||||||
|
needs: prepare
|
||||||
|
uses: ./.gitea/workflows/package.yaml
|
||||||
|
with:
|
||||||
|
working_directory: src/cpl_translation
|
||||||
|
secrets: inherit
|
||||||
@@ -10,20 +10,26 @@ jobs:
|
|||||||
uses: ./.gitea/workflows/prepare.yaml
|
uses: ./.gitea/workflows/prepare.yaml
|
||||||
with:
|
with:
|
||||||
version_suffix: 'dev'
|
version_suffix: 'dev'
|
||||||
|
working_directory: src/cpl_core
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
core:
|
core:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
uses: ./.gitea/workflows/package.yaml
|
uses: ./.gitea/workflows/package.yaml
|
||||||
defaults:
|
with:
|
||||||
run:
|
working_directory: src/cpl_core
|
||||||
working-directory: src/cpl_core
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
query:
|
query:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
uses: ./.gitea/workflows/package.yaml
|
uses: ./.gitea/workflows/package.yaml
|
||||||
defaults:
|
with:
|
||||||
run:
|
working_directory: src/cpl_query
|
||||||
working-directory: src/cpl_query
|
secrets: inherit
|
||||||
|
|
||||||
|
translation:
|
||||||
|
needs: prepare
|
||||||
|
uses: ./.gitea/workflows/package.yaml
|
||||||
|
with:
|
||||||
|
working_directory: src/cpl_translation
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
@@ -8,11 +8,17 @@ on:
|
|||||||
description: 'Suffix for version (z.B. "dev", "alpha", "beta")'
|
description: 'Suffix for version (z.B. "dev", "alpha", "beta")'
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
working_directory:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: [ runner ]
|
runs-on: [ runner ]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ${{ inputs.working_directory }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@@ -27,20 +33,25 @@ jobs:
|
|||||||
|
|
||||||
- name: Set version
|
- name: Set version
|
||||||
run: |
|
run: |
|
||||||
VERSION_SUFFIX="${{ inputs.version_suffix }}"
|
sed -i -E "s/^version = \".*\"/version = \"$(cat /workspace/sh-edraft.de/cpl/version.txt)\"/" pyproject.toml
|
||||||
if [ -n "$VERSION_SUFFIX" ]; then
|
echo "Set version to $(cat /workspace/sh-edraft.de/cpl/version.txt)"
|
||||||
sed -i -E "s/^version = \".*\"/version = \"$(cat version.txt)-$VERSION_SUFFIX\"/" pyproject.toml
|
cat pyproject.toml
|
||||||
else
|
|
||||||
sed -i -E "s/^version = \".*\"/version = \"$(cat version.txt)\"/" pyproject.toml
|
- name: Set pip conf
|
||||||
fi
|
run: |
|
||||||
|
cat > .pip.conf <<'EOF'
|
||||||
|
[global]
|
||||||
|
extra-index-url = https://git.sh-edraft.de/api/packages/sh-edraft.de/pypi/simple/
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
|
export PIP_CONFIG_FILE=".pip.conf"
|
||||||
pip install build
|
pip install build
|
||||||
|
|
||||||
- name: Build Package
|
- name: Build Package
|
||||||
run: |
|
run: |
|
||||||
python -m build --sdist --wheel --outdir dist
|
python -m build --outdir dist
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
|
|||||||
@@ -3,11 +3,22 @@ run-name: Prepare Build Version
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
version_suffix:
|
||||||
|
description: 'Suffix for version (z.B. "dev", "alpha", "beta")'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
working_directory:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: [ runner ]
|
runs-on: [ runner ]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ${{ inputs.working_directory }}
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
uses: https://github.com/actions/checkout@v3
|
uses: https://github.com/actions/checkout@v3
|
||||||
@@ -21,7 +32,16 @@ jobs:
|
|||||||
DATE=$(date +'%Y.%m.%d')
|
DATE=$(date +'%Y.%m.%d')
|
||||||
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
|
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
|
||||||
BUILD_NUMBER=$(($TAG_COUNT + 1))
|
BUILD_NUMBER=$(($TAG_COUNT + 1))
|
||||||
BUILD_VERSION="${DATE}.${BUILD_NUMBER}.dev1"
|
|
||||||
|
VERSION_SUFFIX=${{ inputs.version_suffix }}
|
||||||
|
if [ -n "$VERSION_SUFFIX" ] && [ "$VERSION_SUFFIX" = "dev" ]; then
|
||||||
|
BUILD_VERSION="${DATE}.dev${BUILD_NUMBER}"
|
||||||
|
elif [ -n "$VERSION_SUFFIX" ]; then
|
||||||
|
BUILD_VERSION="${DATE}.${BUILD_NUMBER}${VERSION_SUFFIX}"
|
||||||
|
else
|
||||||
|
BUILD_VERSION="${DATE}.${BUILD_NUMBER}"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$BUILD_VERSION" > version.txt
|
echo "$BUILD_VERSION" > version.txt
|
||||||
echo "VERSION $BUILD_VERSION"
|
echo "VERSION $BUILD_VERSION"
|
||||||
|
|
||||||
@@ -37,4 +57,4 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: version
|
name: version
|
||||||
path: version.txt
|
path: ${{ inputs.working_directory }}/version.txt
|
||||||
2
.pip.conf
Normal file
2
.pip.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[global]
|
||||||
|
extra-index-url = https://git.sh-edraft.de/api/packages/sh-edraft.de/pypi/simple/
|
||||||
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
name = "cpl-query"
|
name = "cpl-query"
|
||||||
version = "2024.7.0"
|
version = "2024.7.0"
|
||||||
description = "CPL query"
|
description = "CPL query"
|
||||||
readme = { text = "CPL query package" }
|
readme ="CPL query package"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
1
src/cpl_query/requirements.dev.txt
Normal file
1
src/cpl_query/requirements.dev.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
black==25.1.0
|
||||||
38
src/cpl_translation/pyproject.toml
Normal file
38
src/cpl_translation/pyproject.toml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=70.1.0", "wheel>=0.43.0"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "cpl-translation"
|
||||||
|
version = "2024.7.0"
|
||||||
|
description = "CPL translation"
|
||||||
|
readme = "CPL translation package"
|
||||||
|
requires-python = ">=3.12"
|
||||||
|
license = { text = "MIT" }
|
||||||
|
authors = [
|
||||||
|
{ name = "Sven Heidemann", email = "sven.heidemann@sh-edraft.de" }
|
||||||
|
]
|
||||||
|
keywords = ["cpl", "translation", "backend", "shared", "library"]
|
||||||
|
|
||||||
|
dynamic = ["dependencies", "optional-dependencies"]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://www.sh-edraft.de"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
package-dir = { "" = "." }
|
||||||
|
include-package-data = true
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
where = ["."]
|
||||||
|
include = ["cpl_translation*"]
|
||||||
|
exclude = [
|
||||||
|
"__pycache__",
|
||||||
|
"logs",
|
||||||
|
"tests",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic]
|
||||||
|
dependencies = { file = ["requirements.txt"] }
|
||||||
|
optional-dependencies.dev = { file = ["requirements.dev.txt"] }
|
||||||
|
|
||||||
1
src/cpl_translation/requirements.dev.txt
Normal file
1
src/cpl_translation/requirements.dev.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
black==25.1.0
|
||||||
1
src/cpl_translation/requirements.txt
Normal file
1
src/cpl_translation/requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cpl-core
|
||||||
Reference in New Issue
Block a user