From b4dee7f55a909567ff1a29479ad608e980d283c6 Mon Sep 17 00:00:00 2001 From: Mayuri Nehate <33225191+mayurinehate@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:26:12 +0530 Subject: [PATCH] ci: add release script for gx plugin (#289) --- .../publish-gx-plugin-pypi-release.yml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/publish-gx-plugin-pypi-release.yml diff --git a/.github/workflows/publish-gx-plugin-pypi-release.yml b/.github/workflows/publish-gx-plugin-pypi-release.yml new file mode 100644 index 0000000000000..af851b9ce2a44 --- /dev/null +++ b/.github/workflows/publish-gx-plugin-pypi-release.yml @@ -0,0 +1,51 @@ +name: pypi-release acryl-datahub-gx-plugin +on: + workflow_dispatch: + release: + types: [published] + +jobs: + setup: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Compute Tag + id: tag + run: | + echo "GITHUB_REF: $GITHUB_REF" + SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA") + TAG=$(echo ${GITHUB_REF} | sed -e 's,refs/tags/v,,g') + echo "tag=$TAG" >> $GITHUB_OUTPUT + push_to_pypi: + name: Build and push python package to PyPI + runs-on: ubuntu-latest + needs: setup + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: 17 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: "pip" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine build + - name: Install dependencies + run: ./metadata-ingestion/scripts/install_deps.sh + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + RELEASE_SKIP_TEST: "true" + run: | + cd metadata-ingestion-modules/gx-plugin + RELEASE_VERSION=${{ needs.setup.outputs.tag }} ./scripts/release.sh