diff --git a/.github/workflows/build-and-publish-core.yaml b/.github/workflows/build-and-publish-core.yaml index cbb7b8ae..0b0e3c97 100644 --- a/.github/workflows/build-and-publish-core.yaml +++ b/.github/workflows/build-and-publish-core.yaml @@ -13,7 +13,12 @@ # limitations under the License. name: Build and Publish Core -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + test: + description: 'Release to test?' + required: false jobs: build-and-publish-core: runs-on: ubuntu-latest @@ -30,7 +35,15 @@ 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 }} 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..66050af8 100644 --- a/.github/workflows/generate-and-publish-sdk.yaml +++ b/.github/workflows/generate-and-publish-sdk.yaml @@ -1,3 +1,17 @@ +# 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: @@ -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..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: @@ -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