diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 1538f43..fb8ebe4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -43,7 +43,8 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Publish Brew formula - env: - PUBLISHED_VERSION: ${{ steps.get_version.outputs.VERSION }} - run: bash publish-brew-formula.sh # installs the latest published version and generates formula + - name: Trigger brew formula generation + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.BREW_GH_TOKEN }} + event-type: socli-released \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aac22f5..7f11092 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ SoCLI Changelog ================ +Release 6.8 +--------------------------- +* Moved brew formula generation to formula repo + Release 6.7 --------------------------- * No change, just dummy build to retry brew publish diff --git a/publish-brew-formula.sh b/publish-brew-formula.sh deleted file mode 100755 index 0edb84b..0000000 --- a/publish-brew-formula.sh +++ /dev/null @@ -1,64 +0,0 @@ -# Generate formula -set -e -pip install homebrew-pypi-poet==0.10.0 requests==2.24.0 -echo Doing pip install --upgrade --no-cache socli="${PUBLISHED_VERSION}" - -# Code to wait till the latest package is available in pypi, if available do install -until pip install --upgrade --no-cache socli=="${PUBLISHED_VERSION}" && [[ "$(socli --version | awk '{print $2}')" == "${PUBLISHED_VERSION}" ]] && true || false -do - echo "Retrying again in 10 seconds..." - sleep 10 -done - -# Generate formula -poet -f socli > socli.rb - -# Replacing with required values for linux -cat << EOF | python -text_to_replace = ''' - def install - virtualenv_create(libexec, "python3") - virtualenv_install_with_resources - end -''' - -new_text = ''' - def install - venv = virtualenv_create(libexec, "python3") - if OS.mac? - virtualenv_install_with_resources - else - venv.pip_install resources - venv.pip_install_and_link buildpath - end - end -''' - -file = open('socli.rb', 'r') -data = file.read() -file.close() -data = data.replace(text_to_replace, new_text) -data = data.replace("Shiny new formula", "Stack overflow command line client. Search and browse stack overflow without leaving the terminal.") -file = open('socli.rb', 'w') -file.write(data) -file.close() -EOF - -echo "Generated formula:" -echo "------------------------------------------------------------------------------------" -cat socli.rb -echo "" -echo "------------------------------------------------------------------------------------" -# Pushing to tap -git config --global user.email "gkr@tuta.io" -git config --global user.name "gkr-bot" -echo "Pulling repo..." -git clone https://"gkr-bot:${BREW_GH_TOKEN}"@github.com/gautamkrishnar/homebrew-socli.git brewroot > /dev/null 2>&1 -echo "Generating formula..." -cp -fv socli.rb brewroot/Formula -cd brewroot -git add --all -echo "Committing formula..." -git commit -m "Published ${PUBLISHED_VERSION}" -echo "Pushing formula..." -git push --quiet \ No newline at end of file diff --git a/socli/version.py b/socli/version.py index be855bc..3defd25 100644 --- a/socli/version.py +++ b/socli/version.py @@ -1 +1 @@ -__version__ = '6.7' +__version__ = '6.8'