Release python (#48)

This commit is contained in:
Sterling Dreyer 2024-09-20 16:42:53 -07:00 committed by GitHub
parent 5b7370c3f0
commit 399ad5f878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 67 additions and 1 deletions

View file

@ -24,6 +24,15 @@ jobs:
packages: write
steps:
- name: Wait for tests to succeed
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.ref }}
running-workflow-name: 'Main'
repo-token: ${{ secrets.PAT }}
wait-interval: 10
ignore-checks: "release-and-publish"
- name: Checkout code
uses: actions/checkout@v3
with:
@ -71,6 +80,30 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: gh workflow -R ArcadeAI/Team run Deploy -f actor-version=${{ env.VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
- 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
run: |
export PKG=$(ls arcade/dist/ | grep tar)
set -- $PKG
echo "TAR_NAME=$1" >> $GITHUB_ENV
export PKG=$(ls arcade/dist/ | grep whl)
set -- $PKG
echo "WHL_NAME=$1" >> $GITHUB_ENV
- name: Generate release notes
id: generate_release_notes
@ -104,3 +137,31 @@ jobs:
asset_path: ./release_notes.md
asset_name: release_notes.md
asset_content_type: text/markdown
- name: Upload Python Tar Asset
uses: actions/upload-release-asset@v1
if: github.event_name != 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./arcade/dist/${{ env.TAR_NAME }}
asset_name: ${{ env.TAR_NAME }}
asset_content_type: application/zip
- name: Upload Python Whl Asset
uses: actions/upload-release-asset@v1
if: github.event_name != 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./arcade/dist/${{ env.WHL_NAME }}
asset_name: ${{ env.WHL_NAME }}
asset_content_type: application/zip
- name: Upload the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: arcade/dist/

View file

@ -1,4 +1,4 @@
VERSION ?= "0.0.0.dev"
.PHONY: install
install: ## Install the poetry environment and install the pre-commit hooks
@ -27,6 +27,11 @@ test-toolkits: ## Iterate over all toolkits and run pytest on each one
(cd $$dir && poetry run pytest -v --cov --cov-config=pyproject.toml --cov-report=xml || exit 1); \
done
.PHONY: set-version
set-version: ## Set the version in the pyproject.toml file
@echo "🚀 Setting version in pyproject.toml"
@cd arcade && poetry version $(VERSION)
.PHONY: build
build: clean-build ## Build wheel file using poetry
@echo "🚀 Creating wheel file"