Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tipoinstalacion py3 #17

Merged
merged 7 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.1.9
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@v5
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.PUB_MASTER_PUSH_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_tipoinstalacion_VERSION
on:
push:
branches: [ master ]
jobs:
bump:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'Bump to v') }}
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_PRIVATE }}
- name: Set up Python 3.11
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 tipoinstalacion --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}" setup.py
git push origin master --tags
fi
49 changes: 49 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tipoinstalacion/Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
# You can use PyPy versions in python-version.
# For example, pypy2 and pypy3
matrix:
python-version: ["2.7", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '2.7'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Python 2
if: matrix.python-version == '2.7'
run: |
sudo apt update
sudo apt install python2 python-pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
printf '1\n' | sudo update-alternatives --config python
cd /usr/bin
sudo ln -s /usr/bin/pip2 ./pip

- name: Upgrade pip
run: |
pip install --upgrade pip setuptools wheel

- name: Install dependencies
run: |
pip install -r requirements-dev.txt
pip install -e .

- name: Run test
run: |
mamba
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mamba
mamba<0.11.0;python_version<="2.7.18"
mamba;python_version>"2.7.18"
expects
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url='https://github.com/gisce/tipoinstalacion',
license='MIT',
author='GISCE-TI, S.L.',
long_description='''ibreria para calcular de forma automática el Tipo de Instalacion (TI)''',
author_email='devel@gisce.net',
description="Libreria para calcular de forma automática el Tipo de"
" Instalacion (TI)"
Expand Down
Loading
Loading