Skip to content

Commit

Permalink
chore: clean up secureli formula references to private download strat…
Browse files Browse the repository at this point in the history
…egies (#36)

* Updated README to include installation & upgrade steps
* Consolidated deployment steps into a separate bash script
* Update formula template to remove all references to private download
strategies

---------

Co-authored-by: Raul Centeno <[email protected]>
  • Loading branch information
centenor and Raul Centeno authored Apr 14, 2023
1 parent 7422e5e commit a0ae55b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 19 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/secureliCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,14 @@ jobs:
uses: actions/checkout@v3
with:
repository: slalombuild/homebrew-secureli
token: ${{ secrets.ADMIN_TOKEN_SASCHA }} # `GH_PAT` is a secret that contains your PAT
token: ${{ secrets.GITHUB_TOKEN }} # `GH_PAT` is a secret that contains your PAT
path: homebrew-secureli
ref: main
fetch-depth: 0
- name: Homebrew Formula Generation
env:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN_SASCHA }}
run: |
pip install requests jinja2 poetry python-semantic-release
export secureliVersion=$(semantic-release print-version --current)
gh release download v$secureliVersion
export secureliSha256=$(sha256sum ./secureli-${secureliVersion}.tar.gz | awk '{print $1}')
git config --global user.email "[email protected]"
git config --global user.name "Secureli Automation"
python ./scripts/get-secureli-dependencies.py
cd homebrew-secureli
git checkout -b "secureli-${secureliVersion}-formula-generation"
git add ./Formula/secureli.rb
git commit -m "Creating pull request with latest Secureli formula for version ${secureliVersion}"
git push origin secureli-${secureliVersion}-formula-generation --repo https://github.com/slalombuild/homebrew-secureli.git
gh release create ${secureliVersion}
gh pr create --title "Secureli Formula Automated Creation for version ${secureliVersion}" --body "Automated formula creation"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/secureli-deployment.sh
test-osx:
runs-on: macos-latest
steps:
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ echo 'export PATH="/Users/[username]/.local/bin:$PATH"' >> /Users/[username]/.zp
source ~/.zprofile
```

# Secureli Installation via Homebrew

Current the only packaging tool that is supported for Secureli is Homebrew. To install secureli via homebrew, issue the following commands

```commandline
brew tap slalombuild/secureli
brew install secureli
```

# Upgrading Secureli via Homebrew

To update secureli, you can use the standard homebrew update command to pull down the latest formula

```commandline
brew update
```

- Install [PyCharm Community Edition](https://www.jetbrains.com/pycharm/download/#section=mac)
- Launch PyCharm and create a new sample project
- Use the Tools menu and select `Create Command-line Launcher...`
Expand Down
24 changes: 24 additions & 0 deletions scripts/secureli-deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -exo pipefail

pip install requests jinja2 poetry python-semantic-release # TODO: Look into Dockerizing these tools so we're not pulling them down each pipeile run
export secureliVersion=$(semantic-release print-version --current)
if git rev-parse "v${secureliVersion}" >/dev/null 2>&1; then
echo "The tag v${secureliVersion} that would have been deployed already exists, ending pipeline execution..."
exit 1
else
echo "The tag v${secureliVersion} does not exist, proceeding with deployment"
echo "Pulling down the most recent published secureli release v${secureliVersion}"
gh release download v$secureliVersion
export secureliSha256=$(sha256sum ./secureli-${secureliVersion}.tar.gz | awk '{print $1}')
git config --global user.email "[email protected]"
git config --global user.name "Secureli Automation"
python ./scripts/get-secureli-dependencies.py
cd homebrew-secureli
git checkout -b "secureli-${secureliVersion}-formula-generation"
git add ./Formula/secureli.rb
git commit -m "Creating pull request with latest Secureli formula for version ${secureliVersion}"
git push origin secureli-${secureliVersion}-formula-generation --repo https://github.com/slalombuild/homebrew-secureli.git
gh release create v${secureliVersion}
gh pr create --title "Secureli Formula Automated Creation for version ${secureliVersion}" --body "Automated formula creation"
fi
2 changes: 0 additions & 2 deletions templates/formula.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require_relative "lib/custom_download_strategy"

class Secureli < Formula
include Language::Python::Virtualenv
desc "SeCureLI is a tool that enables you to experience the delight of building products by helping you get ideas from your head into working software as frictionlessly as possible, in a reliable, secure, scalable, and observable way"
Expand Down

0 comments on commit a0ae55b

Please sign in to comment.