Skip to content

Commit

Permalink
Merge branch 'master' into new_send_face
Browse files Browse the repository at this point in the history
  • Loading branch information
polsala authored Jul 16, 2024
2 parents bf757b0 + 1be930a commit a90814b
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bumpversion]
current_version = 0.3.0
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: false
- name: Run setup
run: |
python setup.py sdist
- name: Creating a realease/pre-release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.tag.outputs.tag}}
draft: false
prerelease: ${{ contains(github.ref, '-rc') }}
generate_release_notes: true
- name: Publish a Python distribution to PyPI
if: ${{ contains(github.ref, '-rc') }} == false
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_MASTER_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/python-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: GISCE_FaceLib_VERION
on:
push:
branches: [ master ]
jobs:
bump:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'Bump to v') }}
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup git
run: |
git config --global user.email "devel@gisce.net"
git config --global user.name "giscegit"
- name: Install python packages
run: |
pip install bump2version
pip install giscemultitools
- name: Get PR info
env:
GITHUB_TOKEN: ${{ secrets.RO_GH_ACTIONS_TOKEN }}
WORKSPACE: ${{github.workspace}}
run: |
echo 'PR_INFO<<EOF' >> $GITHUB_ENV
gisce_github get-commits-sha-from-merge-commit --owner gisce --repository FACe_lib --sha $GITHUB_SHA >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Retrive info
env:
GITHUB_TOKEN: ${{ secrets.PUB_MASTER_PUSH_TOKEN }}
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.SSH_PRIVATE }}'
pr_labels=$( echo '${{ env.PR_INFO }}' | jq -r '.pullRequest.labels' )
is_minor=false
is_major=false
is_patch=false
for label in echo $( echo $pr_labels | jq -r '.[].name' ); do
if [[ $label == 'minor' ]]; then
is_minor=true
elif [[ $label == 'major' ]]; then
is_major=true
elif [[ $label == 'patch' ]]; then
is_patch=true
fi
done
VERSION_TYPE=false
if [[ $is_major == true ]]; then
VERSION_TYPE="major"
elif [[ $is_minor == true ]]; then
VERSION_TYPE="minor"
elif [[ $is_patch == true ]]; then
VERSION_TYPE="patch"
fi
if [[ $VERSION_TYPE != false ]]; then
bump2version $VERSION_TYPE --tag --commit -m "Bump to v{new_version}" face/__init__.py
git push origin master --tags
fi
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
setup(
name='FACe_lib',
description='FACe interface to simplify the interaction with their webservices',
long_description='FACe interface to simplify the interaction with their webservices',
version=face.__version__,
url='http://www.gisce.net',
author='GISCE-TI, S.L.',
Expand All @@ -20,7 +21,7 @@
tests_require=TESTS_REQUIRES,
license='GNU GPLv3',
provides=['FACe_lib'],
classifiers = [
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
]
Expand Down

0 comments on commit a90814b

Please sign in to comment.