Skip to content

Commit 8ceb2f8

Browse files
authored
Add name of custom repository to outputs (#23)
1 parent a6e49bf commit 8ceb2f8

File tree

3 files changed

+56
-44
lines changed

3 files changed

+56
-44
lines changed

README.md

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ Available actions are:
1414
Creates a new github release based on git tags and [semantic versioning](https://semver.org/)
1515

1616
### Inputs
17-
- major_v -- major version of current release
18-
- minor_v -- minor version of current release
17+
| Name | Description | Optional |
18+
|---------|:---------------------------------|----------|
19+
| major_v | major version of current release | False |
20+
| minor_v | minor version of current release | False |
1921

2022
### Outputs
21-
- version -- generated new version of the release
23+
| Name | Description |
24+
|---------|--------------------------------------|
25+
| version | generated new version of the release |
2226

2327
### Usage
2428
```yaml
@@ -35,7 +39,7 @@ jobs:
3539
with:
3640
fetch-depth: 0
3741
- name: Create Release
38-
uses: SneaksAndData/github-actions/semver_release@v0.0.6
42+
uses: SneaksAndData/github-actions/semver_release@v0.0.9
3943
with:
4044
major_v: 0
4145
minor_v: 0
@@ -50,27 +54,24 @@ Optionally can export dependency tree to requirements.txt file.
5054
5155
5256
### Inputs
53-
inputs:
54-
- pypi_repo_url -- URL of python package index (for custom packages)
55-
- pypi_token_username -- Package index authentication username.
56-
- pypi_token -- Package index authentication token or password.
57-
- export_requirements -- Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**.
58-
- export_credentials -- If export_requirements is set to true, it exports requirements.txt with
59-
--with-credentials flag. Otherwise, does nothing. **Optional**. Default value is '**true**'"
60-
- requirements_path -- Path to requirements.txt to be generated (relative to sources root).
61-
**Optional**. Default value is '**.container/requirements.txt**'.
62-
- install_preview -- Install preview version of Poetry. **Optional**. Default value is '**false**'.
63-
This should be set to **true** in build process until Poetry version 1.2.0 is released.
64-
- version -- Version to install. If value is 'latest', script will install the latest available version of Poetry.
65-
**Optional**. Default value is '**latest**'
66-
- install_extras -- List of optional dependencies to install, separated by space. **Optional**. Default is empty.
67-
If value is 'all', all extras will be installed
68-
- install_only_dependencies -- If set to true, installs only dependencies for project, adds the parameter
69-
`--no-root` to `poetry install` command. **Optional**. Default is '**false**'"
70-
- skip_dependencies -- If set to true, installs only poetry without installing dependencies. **Optional**. Default is '**false**'"
57+
| Name | Description | Optional | Default value |
58+
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|----------|-----------------------------|
59+
| pypi_repo_url | URL of python package index (for custom packages) | False | |
60+
| pypi_token_username | Package index authentication username. | False | |
61+
| pypi_token | Package index authentication token or password. | False | |
62+
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | False | |
63+
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
64+
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
65+
| install_preview | Install preview version of Poetry. This should be set to **true** in build process until Poetry version 1.2.0 is released. | True | false |
66+
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
67+
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
68+
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
69+
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |
7170

7271
### Outputs
73-
No outputs defined
72+
| Name | Description |
73+
|------------------|:------------------------------------------------------------|
74+
| custom_repo_name | Name of configured custom repository for poetry push command |
7475

7576
### Usage
7677
```yaml
@@ -86,9 +87,9 @@ jobs:
8687
- uses: actions/checkout@v2
8788
with:
8889
fetch-depth: 0
89-
- name: Install Poetry and dependencies
90-
uses: SneaksAndData/github-actions/install_poetry@v0.0.6
91-
with:
90+
- name: Install Poetry and dependencies
91+
uses: SneaksAndData/github-actions/install_poetry@v0.0.9
92+
with:
9293
pypi_repo_url: ${{ secrets.AZOPS_PYPI_REPO_URL }}
9394
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}
9495
pypi_token: ${{ secrets.AZOPS_PAT }}
@@ -107,12 +108,14 @@ Allows to build helm chart and push it to remote container repository.
107108
This action relies on git tags to be present in order to generate an artifact tag.
108109

109110
### Inputs
110-
- container_registry_address: Container registry address
111-
- application: description: Application name
112-
- container_registry_user: Container registry username
113-
- container_registry_token: Container registry access token
114-
- helm_version: Version of helm to install **Optional**. Default value is **3.9.2**
115-
- helm_directory: Location of helm chart related to project root **Optional**. Default value is **.helm**
111+
| Name | Description | Optional | Default value |
112+
|----------------------------|:-----------------------------------------------|----------|---------------|
113+
| container_registry_address | Container registry address | False | |
114+
| application: | Application name | False | |
115+
| container_registry_user | Container registry username | False | |
116+
| container_registry_token | Container registry access token | False | |
117+
| helm_version | Version of helm to install | True | 3.9.2 |
118+
| helm_directory | Location of helm chart related to project root | True | .helm |
116119

117120
### Outputs
118121
No outputs defined
@@ -132,12 +135,12 @@ jobs:
132135
with:
133136
fetch-depth: 0
134137
- name: Build and Push Chart (DEV)
135-
uses: SneaksAndData/github-actions/build_helm_chart@v0.0.6
136-
with:
137-
application: beast
138-
container_registry_user: ${{secrets.AZCR_DEV_USER}}
139-
container_registry_token: ${{secrets.AZCR_DEV_TOKEN}}
140-
container_registry_address: ${{secrets.AZCR_DEV_USER}}
138+
uses: SneaksAndData/github-actions/build_helm_chart@v0.0.9
139+
with:
140+
application: beast
141+
container_registry_user: ${{secrets.AZCR_DEV_USER}}
142+
container_registry_token: ${{secrets.AZCR_DEV_TOKEN}}
143+
container_registry_address: ${{secrets.AZCR_DEV_USER}}
141144
```
142145

143146
## create_package
@@ -158,10 +161,12 @@ This action relies on git tags to be present in order to generate an artifact ta
158161
3) This action requires to [poetry](https://python-poetry.org/docs/master/) ~1.2 being installed in build environment (for example, by [install_poetry action](#install_poetry))
159162

160163
### Inputs
161-
- pypi_repo_url: Package index URL.
162-
- pypi_token_username: Package index authentication username.
163-
- pypi_token: Package index authentication token or password.
164-
- package_name: Name of package to create. This should match name of root project directory
164+
| Name | Description | Optional | Default value |
165+
|---------------------|:----------------------------------------------------------------------------|----------|---------------|
166+
| pypi_repo_url | Package index URL | False | |
167+
| pypi_token_username | Package index authentication username | False | |
168+
| pypi_token | Package index authentication token or password. | False | |
169+
| package_name | Name of package to create. This should match name of root project directory | False | |
165170

166171
### Outputs
167172
No outputs defined
@@ -185,13 +190,13 @@ jobs:
185190
ref: refs/pull/${{github.event.issue.number}}/merge
186191
fetch-depth: 0
187192
- name: Install Poetry and dependencies
188-
uses: SneaksAndData/github-actions/install_poetry@v0.0.6
193+
uses: SneaksAndData/github-actions/install_poetry@v0.0.9
189194
with:
190195
pypi_repo_url: ${{ secrets.AZOPS_PYPI_REPO_URL }}
191196
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}
192197
pypi_token: ${{ secrets.AZOPS_PAT }}
193198
- name: Create package
194-
uses: SneaksAndData/github-actions/create_package@v0.0.6
199+
uses: SneaksAndData/github-actions/create_package@v0.0.9
195200
with:
196201
pypi_repo_url: ${{ secrets.AZOPS_PYPI_UPLOAD }}
197202
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}

install_poetry/action.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ inputs:
6969
required: false
7070
default: "false"
7171

72+
outputs:
73+
custom_repo_name:
74+
description: "Name of configured custom repository to poetry push command"
75+
value: ${{ steps.install-poetry.outputs.custom_repo_name }}
76+
7277
runs:
7378
using: "composite"
7479
steps:
@@ -87,3 +92,4 @@ runs:
8792
INSTALL_NO_ROOT: ${{ inputs.install_only_dependencies }}
8893
SKIP_DEPENDENCIES: ${{ inputs.skip_dependencies}}
8994
run: $GITHUB_ACTION_PATH/install_poetry.sh
95+
id: install-poetry

install_poetry/install_poetry.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fi
2727
curl -sSL https://install.python-poetry.org | python3 -
2828
export PATH=/github/home/.local/bin:$PATH
2929
poetry config repositories.custom_repo "$REPO_URL"
30+
echo "::set-output name=custom_repo_name::custom_repo"
3031

3132
POETRY_ADDITIONAL_OPTIONS=()
3233
if [[ -n "$EXTRAS" ]]; then

0 commit comments

Comments
 (0)