Ds workflows #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PyPi Wheel | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
- 'release/[0-9]+.[0-9]+' | |
schedule: | |
- cron: '0 0 * * *' | |
# if not dev or release, will create a nightly build | |
# everything is pushed to internal unless created through a nightly scheduled cron job | |
env: | |
INTERNAL: ${{ github.event_name != 'schedule' }} | |
RELEASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/release/[0-9]+.[0-9]+' }} | |
DEV: ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize')}} | |
NAME: ${{ github.event.number }} | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-latest | |
outputs: | |
filename: ${{ steps.build_wheel.outputs.filename }} | |
permissions: | |
id-token: write | |
contents: read | |
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: Print Env | |
run: | | |
echo $DEV | |
echo $NAME | |
- name: Build PyPi Wheel | |
id: build_wheel | |
uses: neuralmagic/nmstore/actions/pypi@pypi-test | |
with: | |
dev: $DEV | |
release: $RELEASE | |
name: $NAME | |
- name: Push to s3 bucket | |
uses: neuralmagic/nmstore/actions/s3@pypi-test | |
with: | |
filename: dist/*.whl | |
internal: $INTERNAL |