From e7eddbddc9b13b86b79d5e75f6ca40fdf0412a40 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 12 Jan 2023 23:59:59 +0900 Subject: [PATCH] ci: parametrize publish (#16343) --- .github/workflows/release-pypi.yml | 38 ++++++++---------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index 71f6d72f4c..b43faed2d1 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -121,6 +121,9 @@ jobs: runs-on: ubuntu-20.04 needs: build-packages if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + strategy: + matrix: + name: ["APP", "FABRIC", "PYTORCH", "LIGHTNING"] steps: - uses: actions/checkout@v3 # needed for local action bellow - uses: actions/download-artifact@v3 @@ -132,26 +135,17 @@ jobs: tree -L 2 -h dist/ - uses: ./.github/actions/pkg-publish with: - pkg-folder: dist/app - pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_APP }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/fabric - pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_FABRIC }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/pytorch - pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_PYTORCH }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/lightning - pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_LAI }} + pkg-folder: dist/$(echo 'console.log("${{ matrix.name }}".toLowerCase())') + pypi-test-token: ${{ secrets[format('PYPI_TEST_TOKEN_{0}', matrix.name)] }} publish-packages: runs-on: ubuntu-20.04 needs: [build-packages, waiting] if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + strategy: + matrix: + name: ["APP", "FABRIC", "PYTORCH", "LIGHTNING"] steps: - uses: actions/checkout@v3 # needed for local action bellow - uses: actions/download-artifact@v3 @@ -163,20 +157,8 @@ jobs: tree -L 2 -h dist/ - uses: ./.github/actions/pkg-publish with: - pkg-folder: dist/app - pypi-token: ${{ secrets.PYPI_TOKEN_APP }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/fabric - pypi-token: ${{ secrets.PYPI_TOKEN_FABRIC }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/pytorch - pypi-token: ${{ secrets.PYPI_TOKEN_PYTORCH }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/lightning - pypi-token: ${{ secrets.PYPI_TOKEN_LAI }} + pkg-folder: dist/$(echo 'console.log("${{ matrix.name }}".toLowerCase())') + pypi-token: ${{ secrets[format('PYPI_TOKEN_{0}', matrix.name)] }} legacy-checkpoints: