From 1cbd1d3fe52ff216621720e6dd497309a27cce57 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 17 Jul 2024 18:54:02 +0200 Subject: [PATCH] Fix matrix value reference in release action (#444) --- .github/workflows/publish-package.yml | 143 +++++++++++++------------- 1 file changed, 70 insertions(+), 73 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index d8484aaabf..649f7be15e 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -6,7 +6,7 @@ # separate terms of service, privacy policy, and support # documentation. -name: Upload Python Package +name: Release and publish on: workflow_dispatch: @@ -35,33 +35,32 @@ permissions: jobs: bump: runs-on: ubuntu-latest - outputs: + outputs: packages: ${{ steps.changesets.outputs.publishedPackages }} steps: - - uses: pnpm/action-setup@v4 - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - name: Install pnpm dependencies - run: pnpm install - - - name: Create Release Pull Request - id: changesets - uses: changesets/action@v1 - with: - version: pnpm ci:version - publish: pnpm ci:publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - + - uses: pnpm/action-setup@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install pnpm dependencies + run: pnpm install + + - name: Create Release Pull Request + id: changesets + uses: changesets/action@v1 + with: + version: pnpm ci:version + publish: pnpm ci:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build: needs: - - bump + - bump strategy: matrix: package: ${{ fromJson(needs.bump.outputs.packages) }} @@ -72,81 +71,79 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build - - name: Bump version.py - run: | - export module=$(sed 's/^.*\///' <<< ${{ package.name }} | tr '-' '/') - sed -i "s/__version__.*/__version__ = \"${{ package.version }}\"/" $module/version.py + - name: Bump version.py + run: | + export module=$(sed 's/^.*\///' <<< ${{ package.name }} | tr '-' '/') + sed -i "s/__version__.*/__version__ = \"${{ package.version }}\"/" $module/version.py - - name: Build package - run: python -m build + - name: Build package + run: python -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: ${{ package.name }}/dist/ + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: ${{ package.name }}/dist/ publish: - needs: - - build + - build runs-on: ubuntu-latest steps: - - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} docs: needs: - - bump - - publish + - bump + - publish strategy: matrix: package: ${{ needs.bump.outputs.packages }} runs-on: ubuntu-latest env: - package: $(sed 's/^.*\///' <<< ${{ package.name }}) + package: $(sed 's/^.*\///' <<< ${{ matrix.package.name }}) module: $(tr '-' '/' <<< $package) steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Install pdoc - run: python -m pip install --upgrade pdoc + - name: Install pdoc + run: python -m pip install --upgrade pdoc - - name: Install package - run: python -m pip install $package/ + - name: Install package + run: python -m pip install $package/ - - name: Build Docs - run: python -m pdoc $module --docformat=google --output-dir docs + - name: Build Docs + run: python -m pdoc $module --docformat=google --output-dir docs - - name: S3 Upload - run: aws s3 cp docs/ s3://livekit-docs/$package --recursive - env: - AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }} - AWS_DEFAULT_REGION: "us-east-1" + - name: S3 Upload + run: aws s3 cp docs/ s3://livekit-docs/$package --recursive + env: + AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }} + AWS_DEFAULT_REGION: "us-east-1"