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

use poetry-dynamic-versioning, update workflows to consolidate steps #2488

Merged
merged 5 commits into from
Aug 12, 2024
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
7 changes: 5 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ ADD --chown=vscode:vscode files/.bash_completion /home/vscode/.bash_completion
RUN mkdir /home/vscode/.bash_completion.d/

# Setup AWS CLI
RUN pip3 install --user awscli poetry==1.5.1
RUN echo "complete -C '/home/vscode/.local/bin/aws_completer' aws" >> ~/.bashrc
RUN set -e; \
pip3 install --no-cache-dir --user awscli pipx; \
pipx install poetry; \
pipx inject poetry "poetry-dynamic-versioning[plugin]" poetry-plugin-export; \
echo "complete -C '/home/vscode/.local/bin/aws_completer' aws" >> ~/.bashrc

# Setup OS_NAME var for runway builds from this dev container
RUN echo "export OS_NAME=ubuntu-latest" >> ~/.bashrc
13 changes: 4 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{html,js,jsx,md,rst,toml,ts,xml,yml,yaml}]
indent_size = 2

[*.py]
charset = utf-8

[*.rst]
indent_size = 2
[{*.{json,py},Makefile}]
indent_size = 4

[Makefile]
indent_style = tab
Expand Down
2 changes: 1 addition & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
color: f0db4f
description: Pull request that updates Javascript code
- name: maintenance
color: fbca04
color: fbca04 # cspell:ignore fbca04
description: General repo or CI/CD upkeep
- name: npm
color: cc3534
Expand Down
44 changes: 24 additions & 20 deletions .github/scripts/cicd/build_pyinstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,46 @@
set -ev

if [ "$OS_NAME" == "ubuntu-latest" ]; then
LOCAL_OS_NAME="linux"
LOCAL_OS_NAME="linux"
elif [ "$OS_NAME" == "macos-12" ]; then
LOCAL_OS_NAME="osx"
LOCAL_OS_NAME="osx"
elif [ "$OS_NAME" == "windows-latest" ]; then
LOCAL_OS_NAME="windows"
LOCAL_OS_NAME="windows"
else
echo 'Environment variable "OS_NAME" must be one of ["ubuntu-latest", "macos-12", "windows-latest"]'
exit 1
echo 'Environment variable "OS_NAME" must be one of ["ubuntu-latest", "macos-12", "windows-latest"]'
exit 1
fi

if [ "$1" != "file" ] && [ "$1" != "folder" ]; then
echo 'First positional argument must be one of ["file", "folder"]'
exit 1
echo 'First positional argument must be one of ["file", "folder"]'
exit 1
fi

RUNWAY_VERSION=$(poetry version --short)

if [[ -z "${GITHUB_ACTION}" ]]; then
rm -rf ./.venv; # NOTE (kyle): this needs to be removed on GitHub
fi

poetry build
poetry run pip install "$(find dist -type f -name 'runway-*.tar.gz' -print | tail -n 1)"
find dist/* -exec rm -rfv "{}" +
mkdir -p "artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}"
poetry run pip show setuptools
poetry run pyinstaller --noconfirm --clean runway.$1.spec
poetry run pyinstaller --noconfirm --clean "runway.$1.spec" # cspell:ignore noconfirm

if [ "$1" == 'file' ]; then
mv dist/* "artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME"
chmod +x "artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME/runway"
# quick functional test
./artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME/runway --version
mv dist/* "artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME"
chmod +x "artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME/runway"
# quick functional test
"./artifacts/${RUNWAY_VERSION}/$LOCAL_OS_NAME/runway" --version
else
if [ "$OS_NAME" == "windows-latest" ]; then
7z a -ttar -so ./runway.tar ./dist/runway/* | 7z a -si "./artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}/runway.tar.gz"
else
chmod +x dist/runway/runway-cli
# quick functional test
./dist/runway/runway-cli --version
tar -C dist/runway/ -czvf ."/artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}/runway.tar.gz" .
fi
if [ "$OS_NAME" == "windows-latest" ]; then
7z a -ttar -so ./runway.tar ./dist/runway/* | 7z a -si "./artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}/runway.tar.gz" # cspell:disable-line
else
chmod +x dist/runway/runway-cli
# quick functional test
./dist/runway/runway-cli --version
tar -C dist/runway/ -czvf ."/artifacts/${RUNWAY_VERSION}/${LOCAL_OS_NAME}/runway.tar.gz" . # cspell:disable-line
fi
fi
12 changes: 6 additions & 6 deletions .github/scripts/cicd/check_distance_from_tag.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Checks for this distance from the last tag.
# If there is no distence, return a non-zero exit code.
# If there is no distance, return a non-zero exit code.
#
# This can be used in GitHub actions with the following steps using conditionals to handle either case.
#
Expand All @@ -20,10 +20,10 @@ DESCRIBE=`git describe --tags --match "v*.*.*"`
echo "Result from 'git describe': ${DESCRIBE}"
DISTANCE=`echo ${DESCRIBE} | grep -P '\-(\d)*\-g(\d)*'`
if [ -n "${DISTANCE}" ]; then
echo "Distance from last tag detected: ${DISTANCE}"
echo "It is safe to proceed with a pre-production release."
exit 0
echo "Distance from last tag detected: ${DISTANCE}"
echo "It is safe to proceed with a pre-production release."
exit 0
else
echo "No distance from last tag; skipping pre-production release."
exit 1
echo "No distance from last tag; skipping pre-production release."
exit 1
fi
Loading