-
Notifications
You must be signed in to change notification settings - Fork 26
52 lines (50 loc) · 1.5 KB
/
build-nmstore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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