From 2be39e76c81b569fce037c30d3f4d1eb918b9c6c Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 17:37:01 +0300 Subject: [PATCH 1/6] chore(git): Delete Old Workflows, Add Publish to Test for Core. --- .github/workflows/build-and-publish-core.yaml | 12 +++++ ...generate-and-publish-sdk-experimental.yaml | 42 ----------------- .../workflows/generate-and-publish-sdk.yaml | 22 +++++++-- .../workflows/generate-sdk-experimental.yaml | 47 ------------------- .github/workflows/generate-sdk.yaml | 12 ++--- 5 files changed, 34 insertions(+), 101 deletions(-) delete mode 100644 .github/workflows/generate-and-publish-sdk-experimental.yaml delete mode 100644 .github/workflows/generate-sdk-experimental.yaml diff --git a/.github/workflows/build-and-publish-core.yaml b/.github/workflows/build-and-publish-core.yaml index cbb7b8ae..31094655 100644 --- a/.github/workflows/build-and-publish-core.yaml +++ b/.github/workflows/build-and-publish-core.yaml @@ -14,6 +14,11 @@ name: Build and Publish Core on: workflow_dispatch +workflow_dispatch: + inputs: + test: + description: 'Release to test?' + required: false jobs: build-and-publish-core: runs-on: ubuntu-latest @@ -34,3 +39,10 @@ jobs: with: password: ${{ secrets.PY_PI_TOKEN }} packages_dir: openworld/sdk/core/dist + - name: Publish to Test PyPI + if: "${{ github.event.inputs.test != '' }}" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.TEST_PY_PI_TOKEN }} + packages_dir: openworld/sdk/core/dist diff --git a/.github/workflows/generate-and-publish-sdk-experimental.yaml b/.github/workflows/generate-and-publish-sdk-experimental.yaml deleted file mode 100644 index 9ffb8255..00000000 --- a/.github/workflows/generate-and-publish-sdk-experimental.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2022 Expedia, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Generate and Publish SDK -on: - workflow_dispatch: - inputs: - version: - description: 'generated sdk version' - required: true - default: '' - name: - description: 'generated sdk name' - required: true - fileAsBase64: - description: 'generated sdk file as base64 encoded' - required: true -jobs: - generate_sdk: - uses: ./.github/workflows/generate-sdk-experimental.yaml - with: - version: ${{ github.event.inputs.version }} - name: ${{ github.event.inputs.name }} - fileAsBase64: ${{ github.event.inputs.fileAsBase64 }} - commit_sdk: - needs: [ generate_sdk ] - uses: ./.github/workflows/commit-sdk.yaml - publish_sdk: - needs: [ generate_sdk ] - uses: ./.github/workflows/publish-sdk.yaml - secrets: inherit diff --git a/.github/workflows/generate-and-publish-sdk.yaml b/.github/workflows/generate-and-publish-sdk.yaml index 203a7c75..40a4d4e0 100644 --- a/.github/workflows/generate-and-publish-sdk.yaml +++ b/.github/workflows/generate-and-publish-sdk.yaml @@ -1,16 +1,30 @@ +# Copyright 2022 Expedia, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Generate and Publish SDK on: workflow_dispatch: inputs: version: - description: 'Generated SDK version' + description: 'generated sdk version' required: true default: '' name: - description: 'Generated SDK name' + description: 'generated sdk name' required: true fileAsBase64: - description: 'Generated SDK file as base64 encoded' + description: 'generated sdk file as base64 encoded' required: true test: description: 'Release to test?' @@ -29,5 +43,3 @@ jobs: needs: [ generate_sdk ] uses: ./.github/workflows/publish-sdk.yaml secrets: inherit - with: - test: ${{ github.event.inputs.test }} diff --git a/.github/workflows/generate-sdk-experimental.yaml b/.github/workflows/generate-sdk-experimental.yaml deleted file mode 100644 index fe7188a0..00000000 --- a/.github/workflows/generate-sdk-experimental.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2022 Expedia, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Generate SDK -on: - workflow_call: - inputs: - version: - description: 'generated sdk version' - required: true - type: string - name: - description: 'generated sdk name' - required: true - type: string - fileAsBase64: - description: 'generated sdk file as base64 encoded' - required: true - type: string -jobs: - generate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: generate_sdk - working-directory: openworld/sdk/generator - run: | - echo ${{ github.event.inputs.name }} - ./scripts/generate-sdk.sh -n "${{ inputs.name }}" -v "${{ inputs.version }}" -i "${{ inputs.fileAsBase64 }}" - - uses: actions/upload-artifact@v3 - with: - name: sdk - path: openworld/sdk/generator/package/dist diff --git a/.github/workflows/generate-sdk.yaml b/.github/workflows/generate-sdk.yaml index afc82f43..fe7188a0 100644 --- a/.github/workflows/generate-sdk.yaml +++ b/.github/workflows/generate-sdk.yaml @@ -33,17 +33,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/setup-python@v4 with: - java-version: '11' - distribution: 'adopt' + python-version: '3.10' - name: generate_sdk - working-directory: generator/scripts + working-directory: openworld/sdk/generator run: | echo ${{ github.event.inputs.name }} - ./generate.sh -n "${{ inputs.name }}" -v "${{ inputs.version }}" -i "${{ inputs.fileAsBase64 }}" + ./scripts/generate-sdk.sh -n "${{ inputs.name }}" -v "${{ inputs.version }}" -i "${{ inputs.fileAsBase64 }}" - uses: actions/upload-artifact@v3 with: name: sdk - path: generator/wheels + path: openworld/sdk/generator/package/dist From da9bc0bbe37a72bd48100237aa407d2b123d2a62 Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 17:53:02 +0300 Subject: [PATCH 2/6] chore(git): Delete Old Workflows, Add Publish to Test for Core. --- .github/workflows/build-and-publish-core.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-core.yaml b/.github/workflows/build-and-publish-core.yaml index 31094655..5e4f40c4 100644 --- a/.github/workflows/build-and-publish-core.yaml +++ b/.github/workflows/build-and-publish-core.yaml @@ -13,8 +13,8 @@ # limitations under the License. name: Build and Publish Core -on: workflow_dispatch -workflow_dispatch: +on: + workflow_dispatch: inputs: test: description: 'Release to test?' From 3b7af46d3120fb382eef3f20203945fed4851e3e Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 17:57:17 +0300 Subject: [PATCH 3/6] chore(git): Delete Old Workflows, Add Publish to Test for Core. --- .github/workflows/build-and-publish-core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-publish-core.yaml b/.github/workflows/build-and-publish-core.yaml index 5e4f40c4..0b0e3c97 100644 --- a/.github/workflows/build-and-publish-core.yaml +++ b/.github/workflows/build-and-publish-core.yaml @@ -35,6 +35,7 @@ jobs: python3 -m pip install build python -m build --sdist --wheel - name: Publish to PyPI + if: "${{ github.event.inputs.test == '' }}" uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PY_PI_TOKEN }} From 099f01555d63f1f4c09142efc35b3da95a74f130 Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 18:06:20 +0300 Subject: [PATCH 4/6] chore(git): Update description in workflows. --- .github/workflows/generate-sdk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-sdk.yaml b/.github/workflows/generate-sdk.yaml index fe7188a0..31a57902 100644 --- a/.github/workflows/generate-sdk.yaml +++ b/.github/workflows/generate-sdk.yaml @@ -17,15 +17,15 @@ on: workflow_call: inputs: version: - description: 'generated sdk version' + description: 'Generated sdk version' required: true type: string name: - description: 'generated sdk name' + description: 'Generated sdk name' required: true type: string fileAsBase64: - description: 'generated sdk file as base64 encoded' + description: 'Generated sdk file as base64 encoded' required: true type: string jobs: From cf6eda5a99c01dae87ca4c00f830b7eb3df52952 Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 18:06:57 +0300 Subject: [PATCH 5/6] chore(git): Update description in workflows. --- .github/workflows/generate-and-publish-sdk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-and-publish-sdk.yaml b/.github/workflows/generate-and-publish-sdk.yaml index 40a4d4e0..7b0ab46b 100644 --- a/.github/workflows/generate-and-publish-sdk.yaml +++ b/.github/workflows/generate-and-publish-sdk.yaml @@ -17,14 +17,14 @@ on: workflow_dispatch: inputs: version: - description: 'generated sdk version' + description: 'Generated sdk version' required: true default: '' name: - description: 'generated sdk name' + description: 'Generated sdk name' required: true fileAsBase64: - description: 'generated sdk file as base64 encoded' + description: 'Generated sdk file as base64 encoded' required: true test: description: 'Release to test?' From 3653a5dadd57eb8562f5f3c31d84d22303159dba Mon Sep 17 00:00:00 2001 From: Omar Al-Jarrah Date: Tue, 2 May 2023 18:07:44 +0300 Subject: [PATCH 6/6] chore(git): Update description in workflows. --- .github/workflows/generate-and-publish-sdk.yaml | 6 +++--- .github/workflows/generate-sdk.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate-and-publish-sdk.yaml b/.github/workflows/generate-and-publish-sdk.yaml index 7b0ab46b..66050af8 100644 --- a/.github/workflows/generate-and-publish-sdk.yaml +++ b/.github/workflows/generate-and-publish-sdk.yaml @@ -17,14 +17,14 @@ on: workflow_dispatch: inputs: version: - description: 'Generated sdk version' + description: 'Generated SDK version' required: true default: '' name: - description: 'Generated sdk name' + description: 'Generated SDK name' required: true fileAsBase64: - description: 'Generated sdk file as base64 encoded' + description: 'Generated SDK file as base64 encoded' required: true test: description: 'Release to test?' diff --git a/.github/workflows/generate-sdk.yaml b/.github/workflows/generate-sdk.yaml index 31a57902..32fe2542 100644 --- a/.github/workflows/generate-sdk.yaml +++ b/.github/workflows/generate-sdk.yaml @@ -17,15 +17,15 @@ on: workflow_call: inputs: version: - description: 'Generated sdk version' + description: 'Generated SDK version' required: true type: string name: - description: 'Generated sdk name' + description: 'Generated SDK name' required: true type: string fileAsBase64: - description: 'Generated sdk file as base64 encoded' + description: 'Generated SDK file as base64 encoded' required: true type: string jobs: