Skip to content

Commit

Permalink
GHA: drop nightly deployment
Browse files Browse the repository at this point in the history
Nightly deployment has been phased out.
  • Loading branch information
antoniofrighetto committed Dec 14, 2023
1 parent 14c8b73 commit f15ac63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 83 deletions.
51 changes: 2 additions & 49 deletions .github/scripts/s3-deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ def get_tag(ci):
# should starts with '<bucket>'.s3.<region>.scw.cloud
# Nevertheless boto3 uses /{Bucket} endpoints suffix
# which create issues (see: https://stackoverflow.com/a/70383653)
OMVLL_S3_REGION = "fr-par"
OMVLL_S3_ENDPOINT = "https://s3.{region}.scw.cloud".format(region=OMVLL_S3_REGION)
OMVLL_S3_BUCKET = "obfuscator"
OMVLL_S3_KEY = os.getenv("OMVLL_S3_KEY", None)
OMVLL_S3_SECRET = os.getenv("OMVLL_S3_SECRET", None)

BUILD38_S3_REGION = "eu-central-1"
BUILD38_S3_ENDPOINT = "https://s3.{region}.amazonaws.com".format(region=BUILD38_S3_REGION)
BUILD38_S3_BUCKET = "build38-open-obfuscator"
Expand All @@ -97,18 +91,13 @@ def get_tag(ci):
BINARIES_CONTENT_TYPE = "binary/octet-stream"
INDEX_CONTENT_TYPE = "text/html"

omvll_keys_set = True
build38_keys_set = True

if (OMVLL_S3_KEY is None or len(OMVLL_S3_KEY) == 0) or (OMVLL_S3_SECRET is None or len(OMVLL_S3_SECRET) == 0):
logger.error("OMVLL_S3_KEY/OMVLL_S3_SECRET not set!")
omvll_keys_set = False

if (BUILD38_S3_KEY is None or len(BUILD38_S3_KEY) == 0) or (BUILD38_S3_SECRET is None or len(BUILD38_S3_SECRET) == 0):
logger.error("BUILD38_S3_KEY/BUILD38_S3_SECRET not set!")
build38_keys_set = False

if not omvll_keys_set and not build38_keys_set:
if not build38_keys_set:
sys.exit(1)

CI_CWD = pathlib.Path(get_ci_workdir(CURRENT_CI))
Expand All @@ -135,15 +124,6 @@ def get_tag(ci):

SKIP_LIST = ["index.html"]

omvll_s3 = boto3.resource(
's3',
region_name=OMVLL_S3_REGION,
use_ssl=True,
endpoint_url=OMVLL_S3_ENDPOINT,
aws_access_key_id=OMVLL_S3_KEY,
aws_secret_access_key=OMVLL_S3_SECRET
)

build38_s3 = boto3.resource(
's3',
region_name=BUILD38_S3_REGION,
Expand Down Expand Up @@ -178,46 +158,19 @@ def generate_index(dir_name: str, s3_bucket_name: str, s3_resource):
html = Template(INDEX_TEMPLATE).render(files=tmpl_info)
return html

dir_name = "latest"

if BRANCH_NAME != "main":
dir_name = "{}".format(BRANCH_NAME.replace("/", "-").replace("_", "-"))

if BRANCH_NAME.startswith("release-"):
_, dir_name = BRANCH_NAME.split("release-")

if IS_TAGGED:
dir_name = str(TAG_NAME)

dir_name = f"{dir_name}/omvll" if omvll_keys_set else "ci"
dir_name = "ci"
logger.info("Destination directory: %s", dir_name)

for file in DIST_DIR.glob("*.zip"):
logger.info("[ZIP ] Uploading '%s'", file.as_posix())
# Nightly deployment
if omvll_keys_set:
push(file.as_posix(), dir_name, OMVLL_S3_BUCKET, omvll_s3, BINARIES_CONTENT_TYPE)
# Experimental deployment
if build38_keys_set:
push(file.as_posix(), dir_name, BUILD38_S3_BUCKET, build38_s3, BINARIES_CONTENT_TYPE)

for file in DIST_DIR.glob("*.tar.gz"):
logger.info("[TAR.GZ] Uploading '%s'", file.as_posix())
# Nightly deployment
if omvll_keys_set:
push(file.as_posix(), dir_name, OMVLL_S3_BUCKET, omvll_s3, BINARIES_CONTENT_TYPE)
# Experimental deployment
if build38_keys_set:
push(file.as_posix(), dir_name, BUILD38_S3_BUCKET, build38_s3, BINARIES_CONTENT_TYPE)

if omvll_keys_set:
nightly_index = generate_index(dir_name, OMVLL_S3_BUCKET, omvll_s3)
with tempfile.TemporaryDirectory() as tmp:
tmp = pathlib.Path(tmp)
index = (tmp / "index.html")
index.write_text(nightly_index)
push(index.as_posix(), dir_name, OMVLL_S3_BUCKET, omvll_s3, INDEX_CONTENT_TYPE, False)

if build38_keys_set:
experimental_index = generate_index(dir_name, BUILD38_S3_BUCKET, build38_s3)
with tempfile.TemporaryDirectory() as tmp:
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/ndk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,7 @@ jobs:
-v /tmp/Python-3.10.7:/Python-3.10.7 \
-v $GITHUB_WORKSPACE:/o-mvll \
openobfuscator/omvll-ndk:latest bash /o-mvll/scripts/docker/ndk_r25_compile.sh
- name: Nightly Deployment
env:
OMVLL_S3_KEY: ${{ secrets.OMVLL_S3_KEY }}
OMVLL_S3_SECRET: ${{ secrets.OMVLL_S3_SECRET }}
shell: bash
run: |
docker run \
-v $GITHUB_WORKSPACE:/o-mvll \
-e GITHUB_ACTIONS="true" \
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
-e GITHUB_REF=$GITHUB_REF \
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
-e OMVLL_S3_KEY=$OMVLL_S3_KEY \
-e OMVLL_S3_SECRET=$OMVLL_S3_SECRET \
--rm \
openobfuscator/deployment python3 /o-mvll/.github/scripts/s3-deploy.py
- name: Experimental Deployment
- name: O-MVLL Deployment
env:
BUILD38_S3_KEY: ${{ secrets.BUILD38_S3_KEY }}
BUILD38_S3_SECRET: ${{ secrets.BUILD38_S3_SECRET }}
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/xcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,7 @@ jobs:
files: |
./omvll_xcode_14.dylib
outPath: ${{ github.workspace }}/dist/omvll_xcode_14.tar.gz
- name: Nightly Deployment
env:
OMVLL_S3_KEY: ${{ secrets.OMVLL_S3_KEY }}
OMVLL_S3_SECRET: ${{ secrets.OMVLL_S3_SECRET }}
shell: bash
run: |
docker run \
-v $GITHUB_WORKSPACE:/o-mvll \
-e GITHUB_ACTIONS="true" \
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
-e GITHUB_REF=$GITHUB_REF \
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
-e OMVLL_S3_KEY=$OMVLL_S3_KEY \
-e OMVLL_S3_SECRET=$OMVLL_S3_SECRET \
--rm \
openobfuscator/deployment python3 /o-mvll/.github/scripts/s3-deploy.py
- name: Experimental Deployment
- name: O-MVLL Deployment
env:
BUILD38_S3_KEY: ${{ secrets.BUILD38_S3_KEY }}
BUILD38_S3_SECRET: ${{ secrets.BUILD38_S3_SECRET }}
Expand Down

0 comments on commit f15ac63

Please sign in to comment.