Fix Package Builds (#82)
This commit is contained in:
parent
7e352fbe91
commit
e7b937e393
2 changed files with 19 additions and 16 deletions
17
.github/workflows/release-containers.yml
vendored
17
.github/workflows/release-containers.yml
vendored
|
|
@ -66,7 +66,7 @@ jobs:
|
||||||
elif [[ $GITHUB_REF == refs/tags/* ]]; then
|
elif [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "VERSION=$(date +'%Y.%m.%d').dev0" >> $GITHUB_ENV
|
echo "VERSION=$(date +'%Y.%-m.%-d').dev0" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build and push Actor image
|
- name: Build and push Actor image
|
||||||
|
|
@ -82,19 +82,6 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
run: gh workflow -R ArcadeAI/Team run Deploy -f actor-version=${{ env.VERSION }}
|
run: gh workflow -R ArcadeAI/Team run Deploy -f actor-version=${{ env.VERSION }}
|
||||||
|
|
||||||
|
|
||||||
- name: Build Dev Python Package
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
run: |
|
|
||||||
make set-version VERSION="0.0.0.dev"
|
|
||||||
make build
|
|
||||||
|
|
||||||
- name: Build Prod Python Package
|
|
||||||
if: github.event_name != 'push'
|
|
||||||
run: |
|
|
||||||
make set-version VERSION=${{ env.VERSION }}
|
|
||||||
make build
|
|
||||||
|
|
||||||
- name: Set TAR and WHL names
|
- name: Set TAR and WHL names
|
||||||
run: |
|
run: |
|
||||||
export PKG=$(ls arcade/dist/ | grep tar)
|
export PKG=$(ls arcade/dist/ | grep tar)
|
||||||
|
|
@ -164,4 +151,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: python-package-distributions
|
name: python-package-distributions
|
||||||
path: arcade/dist/
|
path: dist/
|
||||||
|
|
|
||||||
18
Makefile
18
Makefile
|
|
@ -32,6 +32,11 @@ set-version: ## Set the version in the pyproject.toml file
|
||||||
@echo "🚀 Setting version in pyproject.toml"
|
@echo "🚀 Setting version in pyproject.toml"
|
||||||
@cd arcade && poetry version $(VERSION)
|
@cd arcade && poetry version $(VERSION)
|
||||||
|
|
||||||
|
.PHONY: unset-version
|
||||||
|
unset-version: ## Set the version in the pyproject.toml file
|
||||||
|
@echo "🚀 Setting version in pyproject.toml"
|
||||||
|
@cd arcade && poetry version 0.1.0
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: clean-build ## Build wheel file using poetry
|
build: clean-build ## Build wheel file using poetry
|
||||||
@echo "🚀 Creating wheel file"
|
@echo "🚀 Creating wheel file"
|
||||||
|
|
@ -62,6 +67,10 @@ docker: ## Build and run the Docker container
|
||||||
@cd docker && make docker-build
|
@cd docker && make docker-build
|
||||||
@cd docker && make docker-run
|
@cd docker && make docker-run
|
||||||
|
|
||||||
|
.PHONY: publish-ecr
|
||||||
|
publish-ecr: ## Publish to the ECR
|
||||||
|
@cd docker && make publish-ecr
|
||||||
|
|
||||||
.PHONY: full-dist
|
.PHONY: full-dist
|
||||||
full-dist: clean-dist ## Build all projects and copy wheels to ./dist
|
full-dist: clean-dist ## Build all projects and copy wheels to ./dist
|
||||||
@echo " Building a full distribution with toolkits"
|
@echo " Building a full distribution with toolkits"
|
||||||
|
|
@ -79,14 +88,21 @@ full-dist: clean-dist ## Build all projects and copy wheels to ./dist
|
||||||
# Copy the main arcade project wheel to the dist directory
|
# Copy the main arcade project wheel to the dist directory
|
||||||
@cp arcade/dist/*.whl dist/
|
@cp arcade/dist/*.whl dist/
|
||||||
|
|
||||||
|
@echo "Reset version to default (0.1.0)"
|
||||||
|
@make unset-version
|
||||||
|
|
||||||
@echo "🛠️ Building all projects and copying wheels to ./dist"
|
@echo "🛠️ Building all projects and copying wheels to ./dist"
|
||||||
# Build and copy wheels for each toolkit
|
# Build and copy wheels for each toolkit
|
||||||
@for toolkit_dir in toolkits/*; do \
|
@for toolkit_dir in toolkits/*; do \
|
||||||
if [ -d "$$toolkit_dir" ]; then \
|
if [ -d "$$toolkit_dir" ]; then \
|
||||||
toolkit_name=$$(basename "$$toolkit_dir"); \
|
toolkit_name=$$(basename "$$toolkit_dir"); \
|
||||||
echo "Building $$toolkit_name project..."; \
|
echo "Building $$toolkit_name project..."; \
|
||||||
cd "$$toolkit_dir" && poetry build; \
|
cd "$$toolkit_dir" && poetry version $(VERSION); \
|
||||||
|
awk '{gsub(/arcade-ai = "0.1.\*"/, "arcade-ai = \"$(VERSION)\"")}1' pyproject.toml > temp_file && mv temp_file pyproject.toml; \
|
||||||
|
poetry build; \
|
||||||
cp dist/*.whl ../../dist/toolkits; \
|
cp dist/*.whl ../../dist/toolkits; \
|
||||||
|
poetry version 0.1.0; \
|
||||||
|
awk '{gsub(/arcade-ai = "$(VERSION)"/, "arcade-ai = \"0.1.\*\"")}1' pyproject.toml > temp_file && mv temp_file pyproject.toml; \
|
||||||
cd -; \
|
cd -; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue