-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
77 lines (72 loc) · 2.52 KB
/
action.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: "Poetry CodeArtifact publish Action"
description: Github Action to build and publish a Python package to AWS CodeArtifact with Poetry
inputs:
working-directory:
description: An optional working directory to cd into before building
required: false
default: .
aws-access-key-id:
description: AWS Access Key ID
required: true
aws-secret-access-key:
description: AWS Secret Access Key
required: true
aws-region:
description: AWS Region, e.g. eu-central-1
required: true
role-to-assume:
description: IAM Role to assume that has access to CodeArtifact
required: false
codeartifact-domain:
description: CodeArtifact domain to which the package repository belongs
required: true
codeartifact-domain-owner:
description: Owner (AWS Account) of the CodeArtifact domain
required: true
codeartifact-repository:
description: CodeArtifact repository to which to publish the Python package
required: true
python-version:
description: which Python version to use
required: false
default: "3.10"
poetry-version:
description: which Poetry version to use
required: false
default: "1.3.2"
skip-checkout:
description: if code checkout should be skipped. Useful if you already do a code checkout earlier in your workflow
required: false
default: "false" # warning: composite actions only allow strings as input!
runs:
using: "composite"
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Check out
uses: actions/checkout@v3
if: ${{ inputs.skip-checkout == 'false' }}
with:
fetch-depth: 0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ inputs.poetry-version }}
- name: Authenticate to CodeArtifact
uses: source-ag/codeartifact-login-action@main
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
role-to-assume: ${{ inputs.role-to-assume }}
codeartifact-domain: ${{ inputs.codeartifact-domain }}
codeartifact-domain-owner: ${{ inputs.codeartifact-domain-owner }}
codeartifact-repository: ${{ inputs.codeartifact-repository }}
configure-poetry: true
- name: Publish
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
poetry build
poetry publish -r ${{ inputs.codeartifact-repository }}