Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka committed Apr 3, 2024
1 parent f610bf6 commit bfaaee3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 24 deletions.
54 changes: 54 additions & 0 deletions .github/actions/build-wheel/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build-whl
on:
workflow_call:
inputs:
build_label:
description: "requested runner label"
type: string
required: true
dev:
type: bool
required: true
release:
type: bool
required: true
name:
type: string
internal:
type: bool
filename:
type: string
required: true


jobs:
build:
runs-on: ${{ inputs.build_label }}
outputs:
wheel: ${{ steps.push-wheel.outputs.wheel }}
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Login to s3
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_WEBIDENTITY_FOR_GITHUB_ACTIONS }}
aws-region: us-east-1

- name: Build PyPi Wheel
id: build-wheel
uses: neuralmagic/nm-actions/actions/pypi_build@main
with:
dev: ${{ inputs.dev }}
release: ${{ inputs.release }}
name: ${{ inputs.name }}

- name: Push to s3 bucket
id: push-wheel
uses: neuralmagic/nm-actions/actions/s3_push@main
with:
filename: ${{ inputs.filename }}
internal: ${{ inputs.internal }}

35 changes: 11 additions & 24 deletions .github/workflows/build-wheel-and-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,16 @@ env:

jobs:
build-wheel-and-push:
runs-on: ubuntu-20.04
outputs:
wheel: ${{ steps.push-wheel.outputs.wheel }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to s3
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_WEBIDENTITY_FOR_GITHUB_ACTIONS }}
aws-region: us-east-1
- name: Build PyPi Wheel
id: build-wheel
uses: neuralmagic/nm-actions/actions/pypi_build@main
with:
dev: $DEV
release: $RELEASE
name: $NAME
- name: Push to s3 bucket
id: push-wheel
uses: neuralmagic/nm-actions/actions/s3_push@main
with:
filename: dist/*.whl
internal: $INTERNAL
uses: ./.github/actions/build-wheel/
with:
build-label: ubuntu-20.04
dev: $DEV
release: $RELEASE
name: $NAME
internal: $INTERNAL
filename: dist/*.whl


pull-wheel-and-test:
needs: build-wheel-and-push
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -89,6 +75,7 @@ jobs:
run: |
rm -rf src
make test
build-container-and-push:
needs: pull-wheel-and-test
runs-on: [aws-avx2-64G]
Expand Down

0 comments on commit bfaaee3

Please sign in to comment.