We no longer have to pass --rc-build

That can be inferred from the passed salt version.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-03-17 16:26:45 +00:00
parent 56ac61af0d
commit ff921f9b31
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
6 changed files with 26 additions and 41 deletions

View file

@ -1916,7 +1916,7 @@ jobs:
- name: Upload Repository Contents (nightly)
run: |
tools pkg repo publish nightly artifacts/pkgs/repo/
tools pkg repo publish nightly --salt-version=${{ needs.prepare-workflow.outputs.salt-version }} artifacts/pkgs/repo/
set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks

View file

@ -140,9 +140,7 @@ jobs:
- name: Publish Release Repository
run: |
tools pkg repo publish release \
${{ contains(needs.prepare-workflow.outputs.salt-version, 'rc') && '--rc-build' || '' }} \
--key-id=64CBBC8173D76B3F ${{ needs.prepare-workflow.outputs.salt-version }}
tools pkg repo publish release --salt-version=${{ needs.prepare-workflow.outputs.salt-version }}
release:
name: Release v${{ needs.prepare-workflow.outputs.salt-version }}

View file

@ -1893,8 +1893,7 @@ jobs:
- name: Upload Repository Contents (staging)
run: |
tools pkg repo publish staging \
${{ contains(needs.prepare-workflow.outputs.salt-version, 'rc') && '--rc-build' || '' }} artifacts/pkgs/repo/
tools pkg repo publish staging --salt-version=${{ needs.prepare-workflow.outputs.salt-version }} artifacts/pkgs/repo/
upload-release-artifacts:
name: Upload Release Artifacts

View file

@ -98,9 +98,6 @@ concurrency:
- name: Upload Repository Contents (<{ gh_environment }>)
run: |
tools pkg repo publish <{ gh_environment }>
<%- if gh_environment in ("staging", "release") %> \
${{ contains(needs.prepare-workflow.outputs.salt-version, 'rc') && '--rc-build' || '' }}
<%- endif %> artifacts/pkgs/repo/
tools pkg repo publish <{ gh_environment }> --salt-version=${{ needs.prepare-workflow.outputs.salt-version }} artifacts/pkgs/repo/
<%- endblock jobs %>

View file

@ -178,9 +178,7 @@ permissions:
- name: Publish Release Repository
run: |
tools pkg repo publish release \
${{ contains(needs.prepare-workflow.outputs.salt-version, 'rc') && '--rc-build' || '' }} \
--key-id=<{ gpg_key_id }> ${{ needs.prepare-workflow.outputs.salt-version }}
tools pkg repo publish <{ gh_environment }> --salt-version=${{ needs.prepare-workflow.outputs.salt-version }}
<%- if includes.get("test-pkg-downloads", True) %>
<%- include "test-pkg-repo-downloads.yml.jinja" %>

View file

@ -802,13 +802,21 @@ def src(
"repo_path": {
"help": "Local path for the repository that shall be published.",
},
"salt_version": {
"help": "The salt version for which to build the repository",
"required": True,
},
}
)
def nightly(ctx: Context, repo_path: pathlib.Path):
def nightly(ctx: Context, repo_path: pathlib.Path, salt_version: str = None):
"""
Publish to the nightly bucket.
"""
_publish_repo(ctx, repo_path=repo_path, nightly_build=True)
if TYPE_CHECKING:
assert salt_version is not None
_publish_repo(
ctx, repo_path=repo_path, nightly_build=True, salt_version=salt_version
)
@publish.command(
@ -816,16 +824,19 @@ def nightly(ctx: Context, repo_path: pathlib.Path):
"repo_path": {
"help": "Local path for the repository that shall be published.",
},
"rc_build": {
"help": "Release Candidate repository target",
"salt_version": {
"help": "The salt version for which to build the repository",
"required": True,
},
}
)
def staging(ctx: Context, repo_path: pathlib.Path, rc_build: bool = False):
def staging(ctx: Context, repo_path: pathlib.Path, salt_version: str = None):
"""
Publish to the staging bucket.
"""
_publish_repo(ctx, repo_path=repo_path, rc_build=rc_build, stage=True)
if TYPE_CHECKING:
assert salt_version is not None
_publish_repo(ctx, repo_path=repo_path, stage=True, salt_version=salt_version)
@repo.command(
@ -874,7 +885,6 @@ def backup_previous_releases(ctx: Context, salt_version: str = None):
):
files_to_backup.append((entry["Key"], entry["LastModified"]))
s3 = boto3.client("s3")
with tools.utils.create_progress_bar() as progress:
task = progress.add_task(
"Back up previous releases", total=len(files_to_backup)
@ -919,25 +929,13 @@ def backup_previous_releases(ctx: Context, salt_version: str = None):
"salt_version": {
"help": "The salt version to release.",
},
"rc_build": {
"help": "Release Candidate repository target",
},
"key_id": {
"help": "The GnuPG key ID used to sign.",
"required": True,
},
}
)
def release(
ctx: Context, salt_version: str, key_id: str = None, rc_build: bool = False
):
def release(ctx: Context, salt_version: str):
"""
Publish to the release bucket.
"""
if TYPE_CHECKING:
assert key_id is not None
if rc_build:
if "rc" in salt_version:
bucket_folder = "salt_rc/salt/py3"
else:
bucket_folder = "salt/py3"
@ -962,7 +960,7 @@ def release(
glob_match=glob_match,
)
)
if rc_build:
if "rc" in salt_version:
glob_match = "{bucket_folder}/**/{}~rc{}*".format(
*salt_version.split("rc"), bucket_folder=bucket_folder
)
@ -1051,7 +1049,6 @@ def release(
repo_path,
salt_version,
distro,
rc_build=rc_build,
)
repo_json_path = create_repo_path.parent.parent / "repo.json"
@ -1249,9 +1246,6 @@ def release(
"salt_version": {
"help": "The salt version to release.",
},
"rc_build": {
"help": "Release Candidate repository target",
},
"key_id": {
"help": "The GnuPG key ID used to sign.",
"required": True,
@ -1268,7 +1262,6 @@ def github(
ctx: Context,
salt_version: str,
key_id: str = None,
rc_build: bool = False,
repository: str = "saltstack/salt",
):
"""
@ -1745,8 +1738,8 @@ def _get_file_checksum(fpath: pathlib.Path, hash_name: str) -> str:
def _publish_repo(
ctx: Context,
repo_path: pathlib.Path,
salt_version: str,
nightly_build: bool = False,
rc_build: bool = False,
stage: bool = False,
):
"""