-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor build process, build onefile, upgrade to v2.1.0, add homebrew release #8
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3c969de
initial implementation of a single binary mode
alexrashed d1da173
add explicit step to install python
alexrashed 9ceceac
fix localstack cli version output
alexrashed e4d9a4f
fix tar path
alexrashed 5deeb3b
allow workflow dispatch
alexrashed 4a7b365
do not archive binaries
alexrashed b496f0d
add hidden import for ext cli plugins
alexrashed a9986be
fix windows artifact creation
alexrashed 38a6af2
restructure archives
alexrashed ae47c2c
add push tag trigger
alexrashed 520a5a7
fix permissions
alexrashed 2284bc2
add smoke tests, add folder build
alexrashed 19089e8
try to fix Docker on MacOS
alexrashed 49f4d29
fix cleanup of dist-dir
alexrashed 77cd7cc
try to fix windows encoding error, pre-pull docker images
alexrashed f624a73
disable certain smoke tests for Windows
alexrashed 8c20f1e
unify names
alexrashed 42d2a3f
re-add README for python setup
alexrashed 60efbaf
generate sha256 checksums
alexrashed 53303e7
rename releases, add homebrew releaser
alexrashed 2cd9110
adjust artifact names
alexrashed e15d0d7
another iteration
alexrashed d6f5f51
update readme
alexrashed 811067e
aaand another one
alexrashed 2e67c6e
finalize changes before creating upstream PR
alexrashed 3c103d4
upgrade to localstack==2.1.0
alexrashed d38afef
only execute Pro smoke tests only for non-fork builds
alexrashed a941fdf
add buildjet python installation via pyenv
alexrashed a95f571
explicitly set python patch version, upgrade pyenv action
alexrashed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it makes sense to add older/newer versions of linux distros to make sure we have a range of glibc versions covered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, there's no older version than Ubuntu 20.04 and MacOS 11 for GitHub-hosted runners and just ubuntu-latest for buildjet runners. All these runners currently use GCC 10. Binaries compiled with an older GCC version are compatible to newer ones (they are forward-compatible), so choosing the "oldest" available seemed to be the best approach.
Here's the support policy for GitHub Runners: https://github.com/actions/runner-images#software-and-image-support
They basically always support the last three major versions of the GCC toolchain.