Skip to content

Commit

Permalink
添加ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lvzhenbo committed Jul 28, 2024
1 parent de6a4bd commit 027e279
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release-minor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release Minor

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
ref: main
submodules: recursive

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: |
bun install
cd packages/node-widevine
pnpm install
- name: Build & Release Minor
run: |
bun run release --increment=minor --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
ref: main
submodules: recursive

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: |
bun install
cd packages/node-widevine
pnpm install
- name: Build & Release
run: |
bun run release --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file modified bun.lockb
Binary file not shown.
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
],
"scripts": {
"start": "bun run index.ts",
"build": "bun build ./index.ts --compile --outfile ./build/dcv-decryptor"
"build": "bun build ./index.ts --target=bun-windows-x64 --compile --outfile ./build/dcv-decryptor"
},
"devDependencies": {
"@types/bun": "latest"
"@types/bun": "latest",
"release-it": "^17.6.0"
},
"peerDependencies": {
"typescript": "^5.5.4"
Expand All @@ -25,5 +26,19 @@
"node-widevine": "workspace:*",
"ora": "^8.0.1"
},
"release-it": {
"git": {
"commitMessage": "发布 v${version} 版本"
},
"github": {
"release": true,
"assets": [
"build/dcv-decryptor.exe"
]
},
"hooks": {
"after:git:release": "bun run build"
}
},
"packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e"
}

0 comments on commit 027e279

Please sign in to comment.