-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor build process, build onefile, upgrade to v2.1.0, add homebre…
…w release (#8)
- Loading branch information
1 parent
26b0182
commit 791ffbf
Showing
8 changed files
with
280 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Release Homebrew Tap | ||
|
||
on: | ||
release: | ||
# Start Homebrew Releaser when a new GitHub release of the CLI package is _published_ | ||
types: [published] | ||
|
||
jobs: | ||
homebrew-releaser: | ||
runs-on: ubuntu-latest | ||
name: homebrew-releaser | ||
steps: | ||
- name: Add published release to Homebrew Tap | ||
uses: Justintime50/homebrew-releaser@v1 | ||
with: | ||
# The name of the homebrew tap to publish your formula to as it appears on GitHub. | ||
# Required - strings | ||
homebrew_owner: localstack | ||
homebrew_tap: homebrew-tap | ||
|
||
# Logs debugging info to console. | ||
# Default is shown - boolean | ||
debug: true | ||
|
||
# The name of the folder in your homebrew tap where formula will be committed to. | ||
# Default is shown - string | ||
formula_folder: Formula | ||
|
||
# The Personal Access Token (saved as a repo secret) that has `repo` permissions for the repo running the action AND Homebrew tap you want to release to. | ||
# Required - string | ||
github_token: ${{ secrets.LOCALSTACK_GITHUB_TOKEN }} | ||
|
||
|
||
# Git author info used to commit to the homebrew tap. | ||
# Defaults are shown - strings | ||
commit_owner: localstack-bot | ||
commit_email: 88328844+localstack-bot@users.noreply.github.com | ||
|
||
# Custom install command for your formula. | ||
# Required - string | ||
# The indentation is on purpose to fix the multiline indentation in the final formula | ||
install: | | ||
libexec.install Dir["*"] | ||
bin.install_symlink libexec/"localstack" | ||
# Custom test command for your formula so you can run `brew test`. | ||
# Optional - string | ||
test: | | ||
assert_match /LocalStack Command Line Interface/, shell_output("#{bin}/localstack --help", 0) | ||
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes | ||
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized): | ||
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz' | ||
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz | ||
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz | ||
# Optional - booleans | ||
target_darwin_amd64: true | ||
target_darwin_arm64: true | ||
target_linux_amd64: true | ||
target_linux_arm64: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Build dist folders | ||
dist-bin | ||
dist-dir | ||
|
||
# IntelliJ | ||
.idea/ | ||
*.iml | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,56 @@ | ||
localstack-packaged-cli | ||
LocalStack CLI | ||
======================= | ||
|
||
Repository for the build config that packages the localstack cli into a standalone binary. | ||
|
||
## Build | ||
|
||
This repository contains building instructions for binary builds of the LocalStack CLI. | ||
It does not contain the actual source for the CLI, since the LocalStack CLI is basically just the Python package `localstack` (published on PyPi) with it's install dependencies (and without any extras). | ||
This is why this repository just contains the build config and pipeline that packages the LocalStack CLI python package into a standalone binary using PyInstaller. | ||
|
||
## Creating a Release | ||
In order to create a release, just perform the following tasks: | ||
- Create a commit which sets a new explicit version for `localstack` in the `requirements.txt`. | ||
- For example: `localstack==2.1.0` | ||
- Create a tag for the commit: `v<version>`. | ||
- For example: `git tag v2.1.0` | ||
- Push the tag (`git push origin v<version>`) | ||
- This will trigger the following actions: | ||
- The tag will trigger the ["Build / Release"](.github/workflows/build.yml) GitHub workflow. | ||
- It will build the binaries for the different systems and create a GitHub release draft. | ||
- Publish the GitHub release draft. | ||
- This will trigger the ["Release Homebrew Tap"](.github/workflows/homebrew.yml) GitHub workflow. | ||
- It will take the release artifacts and update the Homebrew formula in [localstack/homebrew-tap](https://github.com/localstack/homebrew-tap). | ||
|
||
### Dev Releases | ||
If a dev release is created, the tag name has to have the same name as the version of `localstack-core` being used (because this is the output of `localstack --version`). | ||
Otherwise, the ["Release Homebrew Tap"](.github/workflows/homebrew.yml) GitHub workflow will not be able to find the artifacts. | ||
|
||
## Manual Build | ||
### python3-dev | ||
|
||
You need Python developer version libraries in your path to be able to build the distribution. | ||
|
||
For most of us who use pyenv, this is done with | ||
|
||
```bash | ||
pyenv install 3.8-dev | ||
pyenv local 3.8-dev | ||
For most of us who use pyenv, this is done with: | ||
- MacOS: | ||
```bash | ||
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10-dev | ||
``` | ||
- Linux: | ||
```bash | ||
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10-dev | ||
``` | ||
|
||
Activate the version: | ||
``` | ||
pyenv local 3.10-dev | ||
python --version | ||
``` | ||
This should print something like `Python 3.10.11+`. | ||
|
||
should print something like `Python 3.8.15+`. | ||
|
||
### make all | ||
|
||
Just run | ||
|
||
### Building | ||
You can build the specific versions by calling the respective make target: | ||
```bash | ||
make clean dist-bin/localstack | ||
# or: | ||
make clean dist-dir/localstack | ||
# or both: | ||
make clean all | ||
``` | ||
|
||
in `dist/localstack` you should now find the binary assets. | ||
|
||
If you want a single binary you can run `PYINSTALLER_ARGS=-F make clean all`. | ||
This will create a single binary `dist/localstack`. | ||
You can find the binary assets in `dist-bin/` and `dist-dir`. | ||
The single binary has a slower startup time than the binary distribution. |
Oops, something went wrong.