Skip to content

Commit

Permalink
Use environments and also switch to make build-package over wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiswl committed Nov 2, 2023
1 parent b1c96c3 commit 74a7b04
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
with:
python-version: '3.10'

- name: Install wheel
run: python -m pip install wheel
- name: Install Build
run: pip install .[build]

- name: Build wheels
run: pip wheel -w dist .
- name: Build Package
run: make build_package

- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist/
path: ./dist/*.whl

1 change: 1 addition & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.dist_artifacts_name }}
path: ${{ inputs.dist_artifacts_path }}

- uses: actions/download-artifact@v3
with:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pipeline_on_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,22 @@ jobs:
docker_container_uri_str_list="${docker_container_uri_str_list},ghcr.io/${{ github.repository }}:latest"
fi
echo "docker_container_uri_str_list=${docker_container_uri_str_list}" >> "${GITHUB_OUTPUT}"
- id: get_environment
run: |
environment="development"
if [[ "${{ steps.is_pre_release.outputs.is_pre_release }}" == "false" ]]; then
environment="production"
fi
echo "environment=${environment}" >> "${GITHUB_OUTPUT}"
# Set outputs of setup job
outputs:
git_tag: ${{ steps.get_tag.outputs.tag }}
is_pre_release: ${{ steps.is_pre_release.outputs.is_pre_release }}
pypi_repository: ${{ steps.get_repository_and_index_url.outputs.pypi_repository }}
index_url: ${{ steps.get_repository_and_index_url.outputs.index_url }}
docker_container_uri_str_list: ${{ steps.get_docker_container_tags.outputs.docker_container_uri_str_list }}
environment: ${{ steps.get_environment.outputs.environment }}

# Run tests and generate report
test:
Expand All @@ -105,9 +114,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10'
# - id: upgrade_pip
# run: |
# pip install --upgrade pip
- id: run_make_test
run: |
make test
Expand Down Expand Up @@ -151,6 +157,7 @@ jobs:
pypi_repository: ${{ needs.setup.outputs.pypi_repository }}
dist_artifacts_name: dist
dist_artifacts_path: dist
environment: ${{ needs.setup.outputs.environment }}

# Now build container
build_container:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
dist_artifacts_path:
required: true
type: string
environment:
required: true
type: string


permissions:
Expand All @@ -23,6 +26,7 @@ permissions:

jobs:
deploy_to_pypi:
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- id: git_checkout
Expand Down

0 comments on commit 74a7b04

Please sign in to comment.