Skip to content

Commit

Permalink
Pre-release mode for dev branch (#469)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
lukasIO and github-actions[bot] authored Jul 23, 2024
1 parent 3ff2f11 commit 1ad214c
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 18 deletions.
18 changes: 18 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"mode": "pre",
"tag": "dev",
"initialVersions": {
"livekit-agents": "0.7.2",
"livekit-plugins/livekit-plugins-azure": "0.2.1",
"livekit-plugins/livekit-plugins-cartesia": "0.1.1",
"livekit-plugins/livekit-plugins-deepgram": "0.5.1",
"livekit-plugins/livekit-plugins-elevenlabs": "0.6.0",
"livekit-plugins/livekit-plugins-google": "0.5.1",
"livekit-plugins/livekit-plugins-minimal": "0.1.0",
"livekit-plugins/livekit-plugins-nltk": "0.6.1",
"livekit-plugins/livekit-plugins-openai": "0.6.0",
"livekit-plugins/livekit-plugins-rag": "0.1.0",
"livekit-plugins/livekit-plugins-silero": "0.5.1"
},
"changesets": []
}
49 changes: 49 additions & 0 deletions .github/workflows/enter-pre-release-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Ensure pre-release mode

on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- edited
branches:
- dev

jobs:
enter-pre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }} # required to checkout the repo when triggered through PRs
ref: ${{ github.event.pull_request.head.ref }} # required to checkout the repo when triggered through PRs
- 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: Enter pre-release mode
id: enter
run: |
set +e
pnpm changeset pre enter dev
echo "exitcode=$?" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add changes
if: ${{ steps.enter.outputs.exitcode == '0' }}
uses: EndBug/add-and-commit@v9
with:
add: '[".changeset"]'
default_author: github_actions
message: enter pre-release mode
49 changes: 49 additions & 0 deletions .github/workflows/exit-pre-release-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Exit pre-release mode

on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- edited
branches:
- main

jobs:
enter-pre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }} # required to checkout the repo when triggered through PRs
ref: ${{ github.event.pull_request.head.ref }} # required to checkout the repo when triggered through PRs
- 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: Enter pre-release mode
id: exit
run: |
set +e
pnpm changeset pre exit
echo "exitcode=$?" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add changes
uses: EndBug/add-and-commit@v9
if: ${{ steps.exit.outputs.exitcode == '0' }}
with:
add: '[".changeset"]'
default_author: github_actions
message: exit pre-release mode
20 changes: 3 additions & 17 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,7 @@ on:
push:
branches:
- main
workflow_call:
inputs:
package_name:
required: true
type: string
package_module:
required: true
type: string
secrets:
PYPI_API_TOKEN:
required: true
DOCS_DEPLOY_AWS_ACCESS_KEY:
required: true
DOCS_DEPLOY_AWS_API_SECRET:
required: true
- dev

jobs:
bump:
Expand All @@ -51,8 +37,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: ${{ github.ref == 'refs/heads/main' && 'pnpm ci:version' || 'pnpm ci:version --snapshot dev' }}
publish: ${{ github.ref == 'refs/heads/main' && 'pnpm ci:publish' || 'pnpm ci:publish --tag dev' }}
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"engines": {
"node": ">= 18"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"dependencies": {}
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ad214c

Please sign in to comment.