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

Fix homebrew scripts #218

Merged
merged 2 commits into from
Aug 16, 2021
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
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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