Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya authored Sep 14, 2024
1 parent 2797dda commit 89f983e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
Expand Down Expand Up @@ -57,21 +57,29 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GIT_HUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: \@oplayer/full github version update
if: steps.changesets.outputs.published == 'true'
uses: wranders/commit-action@v0
with:
message: auto update @oplayer/full
files: |
packages/full/package.json
## @oplayer/full
- name: \@oplayer/full npm publish
if: steps.changesets.outputs.published == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/full
pnpm version prerelease
pnpm set //registry.npmjs.org/:_authToken=$secrets.NPM_TOKEN
pnpm publish
pnpm version prerelease --no-commit-hooks --no-git-tag-version --allow-same-version
cd ../../
pnpm --filter=@oplayer/full run build
pnpm --filter=@oplayer/full publish --no-git-checks
# - uses: simenandre/publish-with-pnpm@v2
# with:
# npm-auth-token: ${{ secrets.NPM_TOKEN }}

- name: Push version changes to main branch
if: steps.changesets.outputs.published == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[skip ci]chore: release ${{ github.event.release.tag_name }}'
branch: ${{ github.event.repository.default_branch }}
file_pattern: packages/full/package.json

# 已被墙
# - name: build websites
Expand Down
9 changes: 3 additions & 6 deletions packages/docs/src/pages/docs/guide/start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Callout, Tab, Tabs } from 'nextra-theme-docs'

## Install

<Tabs items={['npm', 'script', 'script all(~28kB)']}>
<Tabs items={['npm', 'script', 'script (with streams loader)(~28kB)']}>

<Tab>
```shell
Expand All @@ -29,12 +29,10 @@ Player.make('#oplayer', {
name: 'Japanese',
default: true,
src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/君の名は-jp.srt',
offset: 2
},
{
name: 'CH & JP',
src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/君の名は.srt',
offset: 2
}
]
},
Expand Down Expand Up @@ -72,12 +70,10 @@ Player.make('#oplayer', {
name: 'Japanese',
default: true,
src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/君の名は-jp.srt',
offset: 2
},
{
name: 'CH & JP',
src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/君の名は.srt',
offset: 2
}
]
},
Expand All @@ -100,11 +96,12 @@ Player.make('#oplayer', {

<Tab>
```html filename="app.html"
<!-- all in one (~28kB) -->
<!-- (gzip: 28.94 kB) include @oplayer/core @oplayer/ui @oplayer/hls @oplayer/dash @oplayer/mpegts -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/full@latest/dist/index.min.js"></script>
<script>
OPlayer.make('#oplayer', {
source: {
title: '君の名は',
src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/君の名は.mp4',
poster: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/poster.png'
}
Expand Down

0 comments on commit 89f983e

Please sign in to comment.