Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix homebrew scripts (#218)
* Fix homebrew scripts

* Make pylint happy
  • Loading branch information
kmcquade committed Aug 16, 2021
1 parent 2cf7940 commit 0eee035
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
- 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"
Expand All @@ -24,7 +24,7 @@ jobs:
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
printf "# pylint: disable=missing-module-docstring\n__version__ = '$new_tag'\n""" > $version_file
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
git push origin
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Expand Up @@ -75,7 +75,7 @@ jobs:
python-version: 3.7
- name: publish brew
run: |
sleep 2m
sleep 5m
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
pip install homebrew-pypi-poet
Expand All @@ -101,7 +101,7 @@ jobs:
- 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"
Expand All @@ -111,7 +111,7 @@ jobs:
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
17 changes: 16 additions & 1 deletion Makefile
Expand Up @@ -31,7 +31,7 @@ install: build
${PROJECT} --help

# Uninstall the package
uninstall:
uninstall: virtualenv
python3 -m pip uninstall ${PROJECT} -y
python3 -m pip uninstall -r requirements.txt -y
python3 -m pip uninstall -r requirements-dev.txt -y
Expand Down Expand Up @@ -112,3 +112,18 @@ test-js: install-js
.PHONY: serve-js
serve-js: install-js-production
npm run serve

# Update Homebrew file. Does not commit to Git
update-homebrew-file: uninstall
python3 -m pip install homebrew-pypi-poet
python3 -m pip install cloudsplaining -U
git fetch origin
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

update-homebrew: update-homebrew-file
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
2 changes: 1 addition & 1 deletion cloudsplaining/bin/version.py
@@ -1,2 +1,2 @@
# pylint: disable=missing-module-docstring
__version__ = '0.4.5'
__version__ = '0.4.5'
8 changes: 5 additions & 3 deletions utils/update-brew.sh
@@ -1,9 +1,11 @@
#!/usr/bin/env bash
set -x
python3 -m venv ./venv && source venv/bin/activate
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
invoke build.build-package

pip install homebrew-pypi-poet
pip install cloudsplaining -U


pip uninstall -r requirements.txt -y
pip uninstall -r requirements-dev.txt -y
pip install homebrew-pypi-poet
Expand Down

0 comments on commit 0eee035

Please sign in to comment.