Skip to content

0.6.1 🌈

0.6.1 🌈 #43

Workflow file for this run

# .github/workflows/publish.yml
name: Publish
on:
release:
types: [published]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup Python 3.7
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install dependencies
run: |
make setup-dev
- name: Install the package to make sure nothing is randomly broken
run: |
make install
# TODO: fix all pylint issues first
# - name: Pylint
# run: |
# make lint
- name: Run pytest (unit tests) and bandit (security test)
run: |
make security-test
make test
publish-package:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.7
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: create python package
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch --tags
git pull origin master
pip install setuptools wheel twine
python -m setup sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
with:
password: ${{ secrets.PYPI_PASSWORD }}
update-brew:
needs: publish-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python 3.7
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: publish brew
run: |
sleep 5m
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
pip install homebrew-pypi-poet
pip install cloudsplaining -U
git fetch origin
git checkout --track origin/master
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest tag: $latest_tag"
git pull origin $latest_tag
poet -f cloudsplaining > HomebrewFormula/cloudsplaining.rb
git add .
git commit -m "update brew formula" cloudsplaining/bin/version.py HomebrewFormula/cloudsplaining.rb || echo "No brew changes to commit"
git push -u origin master
bump-version:
runs-on: ubuntu-latest
needs: update-brew
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
ref: master
- name: Bump version
run: |
version_file="cloudsplaining/bin/version.py"
# https://github.com/bridgecrewio/checkov/blob/master/.github/workflows/build.yml#L87-L132
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch --tags
git pull origin master
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest tag: $latest_tag"
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
echo "new tag: $new_tag"
printf "# pylint: disable=missing-module-docstring\n__version__ = '$new_tag'""" > $version_file
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
git push origin