Skip to content

Commit d24db02

Browse files
committed
自動でプッシュまで行う
1 parent 7d74bdc commit d24db02

File tree

8 files changed

+1679
-0
lines changed

8 files changed

+1679
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: build and publish package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
12+
checks: write
13+
contents: write
14+
deployments: write
15+
issues: write
16+
packages: write
17+
pull-requests: write
18+
repository-projects: write
19+
security-events: write
20+
statuses: write
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
registry-url: https://npm.pkg.github.com/
28+
29+
- name: Install openapi-generator-cli
30+
run: npm install -g @openapitools/openapi-generator-cli
31+
32+
- name: Generate src
33+
run: openapi-generator-cli generate -i ./docs/cuculus-openapi.yaml -g typescript-fetch -o ./src -c ./config.json
34+
35+
- name: Update package.json version
36+
uses: jossef/action-set-json-field@v1
37+
with:
38+
file: ./package.json
39+
field: version
40+
value: ${{ github.event.release.name }}
41+
42+
- name: Commit and push
43+
run: |
44+
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
45+
git config --global user.name "${GITHUB_ACTOR}"
46+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
47+
git add src/
48+
git commit -m "$(date +'%Y-%m-%d') Update"
49+
git push origin HEAD:${GITHUB_REF}
50+
51+
- name: Package install
52+
run: npm install
53+
54+
- name: Publish package
55+
run: npm publish
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env*.local
29+
30+
# vercel
31+
.vercel
32+
33+
# typescript
34+
*.tsbuildinfo
35+
next-env.d.ts
36+
37+
# IDE
38+
.idea
39+
40+
# generated
41+
src/.openapi-generator
42+
src/.openapi-generator-ignore
43+
openapitools.json
44+
45+
# build
46+
dist

README.md

494 Bytes

cuculus-api-typescript-sdk

Install openapi-generator-cli

npm install -g @openapitools/openapi-generator-cli

Generate src

openapi-generator-cli generate -i ./docs/cuculus-openapi.yaml -g typescript-fetch -o ./src -c ./config.json

config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

0 commit comments

Comments
 (0)