Skip to content

Commit

Permalink
chore: setup sync release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 26, 2023
1 parent 8d8c4f9 commit edc8b2d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HASH=$(md5sum releases.json | cut -d ' ' -f 1)
echo '{"name":"@koishijs/releases","main":"releases.json"}' | jq ".version=\"0.0.0-$HASH\"" > package.json
cat package.json
npm publish --access public --tag latest
26 changes: 26 additions & 0 deletions .github/workflows/sync-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sync Release

on:
release:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v4

- run: |
curl -L \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$GITHUB_REPO/releases" \
-o releases.json
cat releases.json
ls
- name: Publish
run: bash .github/workflows/publish.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@root/koishi",
"version": "1.0.0",
"type": "module",
"private": true,
"packageManager": "[email protected]",
"workspaces": [
Expand Down
13 changes: 13 additions & 0 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "./tsconfig.base",
"compilerOptions": {
"rootDir": "src",
"emitDeclarationOnly": false,
"noEmit": true,
"module": "esnext",
"moduleResolution": "bundler",
},
"include": [
"scripts",
],
}

0 comments on commit edc8b2d

Please sign in to comment.