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

feat(action): add dry_run option for upload validation (PACMAN-669) #12

Merged
merged 2 commits into from
Jul 17, 2023
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-bullseye

RUN pip install "idf-component-manager~=1.2" "urllib3<2"
RUN pip install "idf-component-manager~=1.3"

COPY upload.sh /upload.sh

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ jobs:
| version | ✔ | | Version of the component, if not specified in the manifest. Should be a [semver](https://semver.org/) like `1.2.3` or `v1.2.3` |
| directories | ✔ | Repo root | Semicolon separated list of directories with components. |
| skip_pre_release | ✔ | False | Flag to skip [pre-release](https://semver.org/#spec-item-9) versions |
| dry_run | ✔ | False | Flag to upload a component for validation only without creating a version in the registry. |
| service_url | ✔ | https://components.espressif.com/api | (Deprecated) IDF Component registry API URL |
| registry_url | ✔ | https://components.espressif.com/ | IDF Component registry URL |
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ inputs:
skip_pre_release:
description: "Flag to skip pre-release versions. Set it to any non-empty string to skip pre-release versions."
required: false
dry_run:
description: "Upload component for validation without creating a version in the registry."
required: false
runs:
using: "docker"
image: "Dockerfile"
Expand All @@ -42,3 +45,4 @@ runs:
DEFAULT_COMPONENT_SERVICE_URL: ${{ inputs.service_url }}
IDF_COMPONENT_REGISTRY_URL: ${{ inputs.registry_url }}
SKIP_PRE_RELEASE: ${{ inputs.skip_pre_release }}
DRY_RUN: ${{ inputs.dry_run }}
3 changes: 3 additions & 0 deletions upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ UPLOAD_ARGUMENTS=("--allow-existing" "--namespace=${NAMESPACE}" )
if [ -n "$SKIP_PRE_RELEASE" ]; then
UPLOAD_ARGUMENTS+=("--skip-pre-release")
fi
if [ -n "$DRY_RUN" ]; then
UPLOAD_ARGUMENTS+=("--dry-run")
fi

if [ -n "$COMPONENT_VERSION" ]; then
if [ "$COMPONENT_VERSION" == "git" ]; then
Expand Down