Skip to content

Commit

Permalink
feat: fall detect pypi publishing (#32)
Browse files Browse the repository at this point in the history
* feat: add temp file

Signed-off-by: bhavikapanara <[email protected]>

* feat: fall detect

Signed-off-by: bhavikapanara <[email protected]>

* add setup files

Signed-off-by: bhavikapanara <[email protected]>
  • Loading branch information
bhavikapanara authored Oct 3, 2021
1 parent 3e7658c commit 87f1751
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 17 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python package locally
Expand Down Expand Up @@ -46,16 +46,16 @@ jobs:
release:
name: Release Job
needs: [build]
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Install Node.js 12
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: lts/*
- name: Install Python 3
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Semantic Release Tool
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -25,4 +25,5 @@ jobs:
cp README.md src/
cd src
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload --verbose --repository testpypi dist/*
# twine upload dist/*
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ __pycache__/

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branch": "master",
"branches": ["main", "master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
23 changes: 23 additions & 0 deletions build/prepare-semantic-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# verbose mode
set -x

RELEASE_VERSION=$1
a=( ${RELEASE_VERSION//./ } )
MAJOR=${a[0]}
MINOR=${a[1]}
PATCH=${a[2]}
echo "RELEASE_VERSION=$RELEASE_VERSION"
echo "MAJOR=$MAJOR"
echo "MINOR=$MAJOR.$MINOR"
echo "PATCH=$PATCH"

# update version info in the ambianic python package setup.cfg
cp README.md src/
cd src
python3 setup.py setopt --command metadata --option version --set-value $RELEASE_VERSION

# verify if version is updated in setup.cfg
echo "verify if version is updated in setup.cfg"
cat setup.cfg
46 changes: 46 additions & 0 deletions build/semantic-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# exit bash script on error
# set -e

# verbose mode
set -x

pwd

node --version
npm --version

# install nvm
sudo apt-get update
sudo apt-get install build-essential checkinstall libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
export NVM_DIR="/home/travis/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

command -v nvm
nvm ls

# nvm install node --reinstall-packages-from=$(nvm current)
nvm install lts/* --reinstall-packages-from=node
nvm ls
nvm uninstall v8
nvm ls

# npm cache clean -f
# npm install n
# n stable
node --version

npm install npm@latest
# npm install -U node
# npm install lts/*
npm install --save-dev @semantic-release/commit-analyzer
npm install --save-dev @semantic-release/git
npm install --save-dev semantic-release
npm install --save-dev semantic-release-docker
npm install --save-dev @semantic-release/release-notes-generator
npm install --save-dev @semantic-release/github
npm install --save-dev @semantic-release/changelog
npm install --save-dev @semantic-release/exec
node --version
npx semantic-release
8 changes: 3 additions & 5 deletions src/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ long_description_content_type = text/markdown
url = https://ambianic.ai
license = Apache Software License 2.0
classifiers =
Development Status :: Beta
Development Status :: 4 - Beta
Programming Language :: Python :: 3
OSI Approved :: Apache Software License
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
TOPIC :: HOME AUTOMATION
TOPIC :: SCIENTIFIC/ENGINEERING :: ARTIFICIAL INTELLIGENCE
TOPIC :: SOFTWARE DEVELOPMENT :: EMBEDDED SYSTEMS
Topic :: Software Development :: Embedded Systems
Intended Audience :: Developers

[options]
Expand Down

0 comments on commit 87f1751

Please sign in to comment.