Add multiple team handling #210
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Candidates | |
on: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release Candidate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: pnpm/action-setup@v3 | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }} | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }} | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org | |
cache: pnpm | |
- name: Configure pnpm | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }} | |
run: | | |
pnpm config set auto-install-peers true | |
pnpm config set exclude-links-from-lockfile true | |
- name: Install dependencies | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }} | |
run: pnpm install --frozen-lockfile | |
- name: Release JS Candidate | |
working-directory: packages/js-sdk | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }} | |
run: | | |
npm version prerelease --preid=${{ github.head_ref }} | |
npm publish --tag rc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release CLI Candidate | |
working-directory: packages/cli | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }} | |
run: | | |
npm version prerelease --preid=${{ github.head_ref }} | |
npm publish --tag rc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }} | |
with: | |
python-version: "3.10" | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }} | |
with: | |
version: 1.5.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Release Candidate | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }} | |
working-directory: packages/python-sdk | |
run: | | |
poetry version prerelease | |
poetry build | |
poetry config pypi-token.pypi ${PYPI_TOKEN} && poetry publish --skip-existing | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
- name: Commit new versions | |
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git commit -am "[skip ci] Release new versions" || exit 0 | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |