-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (47 loc) · 1.73 KB
/
python_codeartifact_push.yml
File metadata and controls
55 lines (47 loc) · 1.73 KB
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
53
54
55
name: Build and publish Python 🐍 distributions 📦 to CodeArtifact
on:
workflow_call:
inputs:
repository:
description: CodeArtifact repository name
type: string
required: true
domain:
description: CodeArtifact domain name
type: string
required: true
domain_owner:
description: AWS account ID where your repo's domain lives
type: number
required: true
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to CodeArtifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: setup awscli
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Connect pip and twine to CodeArtifact
run: |
aws codeartifact login --tool pip --repository ${{ inputs.repository }} --domain ${{ inputs.domain }} --domain-owner ${{ inputs.domain_owner }}
aws codeartifact login --tool twine --repository ${{ inputs.repository }} --domain ${{ inputs.domain }} --domain-owner ${{ inputs.domain_owner }}
- name: Install pypa/build + twine
run: python -m pip install build twine
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to CodeArtifact
run: twine upload -r codeartifact dist/*