Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add name of custom repository to outputs #23

Merged
merged 6 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 49 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ Available actions are:
Creates a new github release based on git tags and [semantic versioning](https://semver.org/)

### Inputs
- major_v -- major version of current release
- minor_v -- minor version of current release
| Name | Description | Optional |
|---------|:---------------------------------|----------|
| major_v | major version of current release | False |
| minor_v | minor version of current release | False |

### Outputs
- version -- generated new version of the release
| Name | Description |
|---------|--------------------------------------|
| version | generated new version of the release |

### Usage
```yaml
Expand All @@ -35,7 +39,7 @@ jobs:
with:
fetch-depth: 0
- name: Create Release
uses: SneaksAndData/github-actions/[email protected].6
uses: SneaksAndData/github-actions/[email protected].9
with:
major_v: 0
minor_v: 0
Expand All @@ -50,27 +54,24 @@ Optionally can export dependency tree to requirements.txt file.


### Inputs
inputs:
- pypi_repo_url -- URL of python package index (for custom packages)
- pypi_token_username -- Package index authentication username.
- pypi_token -- Package index authentication token or password.
- export_requirements -- Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**.
- export_credentials -- If export_requirements is set to true, it exports requirements.txt with
--with-credentials flag. Otherwise, does nothing. **Optional**. Default value is '**true**'"
- requirements_path -- Path to requirements.txt to be generated (relative to sources root).
**Optional**. Default value is '**.container/requirements.txt**'.
- install_preview -- Install preview version of Poetry. **Optional**. Default value is '**false**'.
This should be set to **true** in build process until Poetry version 1.2.0 is released.
- version -- Version to install. If value is 'latest', script will install the latest available version of Poetry.
**Optional**. Default value is '**latest**'
- install_extras -- List of optional dependencies to install, separated by space. **Optional**. Default is empty.
If value is 'all', all extras will be installed
- install_only_dependencies -- If set to true, installs only dependencies for project, adds the parameter
`--no-root` to `poetry install` command. **Optional**. Default is '**false**'"
- skip_dependencies -- If set to true, installs only poetry without installing dependencies. **Optional**. Default is '**false**'"
| Name | Description | Optional | Default value |
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|----------|-----------------------------|
| pypi_repo_url | URL of python package index (for custom packages) | False | |
| pypi_token_username | Package index authentication username. | False | |
| pypi_token | Package index authentication token or password. | False | |
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | False | |
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
| 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 |
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |

### Outputs
No outputs defined
| Name | Description |
|------------------|:------------------------------------------------------------|
| custom_repo_name | Name of configured custom repository for poetry push command |

### Usage
```yaml
Expand All @@ -86,9 +87,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Poetry and dependencies
uses: SneaksAndData/github-actions/[email protected].6
with:
- name: Install Poetry and dependencies
uses: SneaksAndData/github-actions/[email protected].9
with:
pypi_repo_url: ${{ secrets.AZOPS_PYPI_REPO_URL }}
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}
pypi_token: ${{ secrets.AZOPS_PAT }}
Expand All @@ -107,12 +108,14 @@ Allows to build helm chart and push it to remote container repository.
This action relies on git tags to be present in order to generate an artifact tag.

### Inputs
- container_registry_address: Container registry address
- application: description: Application name
- container_registry_user: Container registry username
- container_registry_token: Container registry access token
- helm_version: Version of helm to install **Optional**. Default value is **3.9.2**
- helm_directory: Location of helm chart related to project root **Optional**. Default value is **.helm**
| Name | Description | Optional | Default value |
|----------------------------|:-----------------------------------------------|----------|---------------|
| container_registry_address | Container registry address | False | |
| application: | Application name | False | |
| container_registry_user | Container registry username | False | |
| container_registry_token | Container registry access token | False | |
| helm_version | Version of helm to install | True | 3.9.2 |
| helm_directory | Location of helm chart related to project root | True | .helm |

### Outputs
No outputs defined
Expand All @@ -132,12 +135,12 @@ jobs:
with:
fetch-depth: 0
- name: Build and Push Chart (DEV)
uses: SneaksAndData/github-actions/[email protected].6
with:
application: beast
container_registry_user: ${{secrets.AZCR_DEV_USER}}
container_registry_token: ${{secrets.AZCR_DEV_TOKEN}}
container_registry_address: ${{secrets.AZCR_DEV_USER}}
uses: SneaksAndData/github-actions/[email protected].9
with:
application: beast
container_registry_user: ${{secrets.AZCR_DEV_USER}}
container_registry_token: ${{secrets.AZCR_DEV_TOKEN}}
container_registry_address: ${{secrets.AZCR_DEV_USER}}
```

## create_package
Expand All @@ -158,10 +161,12 @@ This action relies on git tags to be present in order to generate an artifact ta
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))

### Inputs
- pypi_repo_url: Package index URL.
- pypi_token_username: Package index authentication username.
- pypi_token: Package index authentication token or password.
- package_name: Name of package to create. This should match name of root project directory
| Name | Description | Optional | Default value |
|---------------------|:----------------------------------------------------------------------------|----------|---------------|
| pypi_repo_url | Package index URL | False | |
| pypi_token_username | Package index authentication username | False | |
| pypi_token | Package index authentication token or password. | False | |
| package_name | Name of package to create. This should match name of root project directory | False | |

### Outputs
No outputs defined
Expand All @@ -185,13 +190,13 @@ jobs:
ref: refs/pull/${{github.event.issue.number}}/merge
fetch-depth: 0
- name: Install Poetry and dependencies
uses: SneaksAndData/github-actions/[email protected].6
uses: SneaksAndData/github-actions/[email protected].9
with:
pypi_repo_url: ${{ secrets.AZOPS_PYPI_REPO_URL }}
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}
pypi_token: ${{ secrets.AZOPS_PAT }}
- name: Create package
uses: SneaksAndData/github-actions/[email protected].6
uses: SneaksAndData/github-actions/[email protected].9
with:
pypi_repo_url: ${{ secrets.AZOPS_PYPI_UPLOAD }}
pypi_token_username: ${{ secrets.AZOPS_PAT_USER }}
Expand Down
6 changes: 6 additions & 0 deletions install_poetry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ inputs:
required: false
default: "false"

outputs:
custom_repo_name:
description: "Name of configured custom repository to poetry push command"
value: ${{ steps.install-poetry.outputs.custom_repo_name }}

runs:
using: "composite"
steps:
Expand All @@ -87,3 +92,4 @@ runs:
INSTALL_NO_ROOT: ${{ inputs.install_only_dependencies }}
SKIP_DEPENDENCIES: ${{ inputs.skip_dependencies}}
run: $GITHUB_ACTION_PATH/install_poetry.sh
id: install-poetry
1 change: 1 addition & 0 deletions install_poetry/install_poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fi
curl -sSL https://install.python-poetry.org | python3 -
export PATH=/github/home/.local/bin:$PATH
poetry config repositories.custom_repo "$REPO_URL"
echo "::set-output name=custom_repo_name::custom_repo"

POETRY_ADDITIONAL_OPTIONS=()
if [[ -n "$EXTRAS" ]]; then
Expand Down