-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Clean up some docs and packages
- Loading branch information
1 parent
d7a8a21
commit 2f8bd0b
Showing
8 changed files
with
191 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
|
||
name: Set up environment | ||
description: Runs setup actions and installs packages | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: pnpm/action-setup@v4 | ||
|
||
- uses: buildjet/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'pnpm' | ||
|
||
- run: pnpm install --frozen-lockfile | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Fetch all commit history for generating the changelog. | ||
fetch-depth: 0 | ||
# Avoid configuring the token with the local git config in favor of | ||
# our own environment token (see below). | ||
persist-credentials: false | ||
|
||
- uses: pnpm/action-setup@v4 | ||
|
||
- uses: buildjet/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "pnpm" | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
timeout-minutes: 5 | ||
|
||
- name: Create release pull request or publish | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm run ci:version | ||
commit: "chore: Update versions" | ||
title: "chore: Update versions" | ||
publish: pnpm run ci:publish | ||
env: | ||
# When you use the repository's GITHUB_TOKEN to perform tasks, events | ||
# triggered by the GITHUB_TOKEN will not create a new workflow run. | ||
# This means that checks won't run on the release PRs. We work around | ||
# this by using our own GH_TOKEN_REPO_ACCESS organization secret. | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO_ACCESS }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Snapshot Release | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
|
||
jobs: | ||
snapshot: | ||
name: Snapshot Release | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
if: github.event.issue.pull_request && github.event.comment.body == '/snapshot' | ||
steps: | ||
- name: Add initial comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
body: | | ||
Follow snapshot progress [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: eyes | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
# issue_comment requires us to checkout the branch | ||
# https://github.com/actions/checkout/issues/331#issuecomment-1120113003 | ||
- name: Checkout pull request branch | ||
run: hub pr checkout ${{ github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
timeout-minutes: 5 | ||
|
||
- name: Check if changeset exists | ||
run: | | ||
pnpm exec changeset status --since main | ||
- name: Add final comment (failure) | ||
if: failure() | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
body: | | ||
:x: A changeset is required to build a snapshot. | ||
reactions: confused | ||
|
||
- name: Publish snapshot release | ||
run: | | ||
pnpm exec changeset version --snapshot ${{ github.event.issue.number }} && pnpm install | ||
pnpm run ci:publish --no-git-tag --snapshot | ||
- name: Retrieve snapshot version | ||
run: | | ||
echo "SNAPSHOT_VERSION=$(npm view @plex/core-logging versions --json | grep 0.0.0-${{ github.event.issue.number }} | sort -r | head -n 1 | cut -d'"' -f 2)" >> $GITHUB_OUTPUT | ||
id: snapshotVersion | ||
|
||
- name: Add final comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
body: | | ||
${{steps.snapshotVersion.outputs.SNAPSHOT_VERSION}} has been published. | ||
reactions: rocket |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Run tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: buildjet-2vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
if: ${{ github.event_name != 'pull_request' }} | ||
|
||
- uses: actions/checkout@v4 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- uses: pnpm/action-setup@v4 | ||
|
||
- uses: buildjet/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
cache: "pnpm" | ||
|
||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
timeout-minutes: 5 | ||
|
||
- name: Lint | ||
run: pnpm run lint | ||
|
||
# - name: Check types | ||
# run: pnpm run tsc | ||
|
||
- name: Run unit tests | ||
run: pnpm run test |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"local>plexinc/renovate-config" | ||
] | ||
"extends": ["local>plexinc/renovate-config"] | ||
} |