Skip to content

Commit

Permalink
Deploy on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Oct 5, 2022
1 parent 6f6f86e commit 1a3f81b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
43 changes: 27 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,52 @@ name: Continuous integration
on:
push:

env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}

jobs:
main:
name: Continuous integration
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 60
env:
TX_USR: ${{ secrets.TX_USR }}
TX_PWD: ${{ secrets.TX_PWD }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- uses: actions/checkout@v3

- name: Install packages
run: sudo apt-get install -y gettext python3-virtualenv
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 10

- name: Build
run: make build

- name: Lint
run: make check

- name: Tests
run: make test

- name: Docker compose logs
if: always()
run: |
docker-compose logs
docker-compose down -v --remove-orphans
- name: Deploy PyPI
if: >
github.repository == 'camptocamp/c2cgeoform'
&& success()
&& (
startsWith(github.ref, 'refs/tags/')
)
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: pypi
if: env.HAS_SECRETS == 'HAS_SECRETS'

- name: Install c2cciutils
run: |
sudo python3 -m pip install twine wheel
scripts/deploy-pypi
echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
python3 -m pip install --user --upgrade pip
python3 -m pip install --user --requirement=ci/requirements.txt
- name: Publish
run: c2cciutils-publish
if: env.HAS_SECRETS == 'HAS_SECRETS'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
*.egg-info

.build/
build/
dist/
docs/_build
8 changes: 8 additions & 0 deletions ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/master/c2cciutils/schema.json

publish:
docker:
images: []
pypi:
versions:
- version_tag
1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c2cciutils[publish]==1.3.7
3 changes: 2 additions & 1 deletion scripts/deploy-pypi
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ else
fi

function deploy_pypi {
rm -rf dist/*
make compile-catalog
VERSION=$1 python3 setup.py egg_info sdist bdist_wheel
twine upload dist/*
twine upload -r testpypi dist/*
}

# Deploy tags
Expand Down

0 comments on commit 1a3f81b

Please sign in to comment.