Skip to content

Commit

Permalink
Merge pull request #23 from jcam1/develop
Browse files Browse the repository at this point in the history
Release 2024-08-26 11:47:19 +0900
  • Loading branch information
SeiyaKobayashi authored Aug 26, 2024
2 parents 1a5d565 + 3d06630 commit 797da78
Show file tree
Hide file tree
Showing 105 changed files with 15,400 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .github/.git-pr-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Release <%= Time.now %>
<% pull_requests.each do |pr| -%>
- #<%= pr.number %> <%= pr.title %> <%= pr.mention %>
<% end -%>
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature Request
about: Submit a feature request
title: ''
labels: ['feature request']
assignees: ''
---

<!-- Edit issue title -->

## 🌈 Overview

<!-- Write a brief overview of this feature request in a few sentences -->

## ❓ Motivation

<!-- Summarize motivation/background of this feature request. Why should our SDK have this feature? -->

## 🎨 Description

<!-- Describe a detailed description of this feature request -->

## 📚 References

<!-- Put a list of external links related to this issue (if any) -->
14 changes: 14 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: install dependencies
description: set up node & install dependencies

runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@jpyc'
- name: Install dependencies
shell: bash
run: yarn --frozen-lockfile
15 changes: 15 additions & 0 deletions .github/actions/publish-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: publish package
description: publish an npm package
inputs:
node-auth-token:
description: 'node token for authorization'
required: true

runs:
using: composite
steps:
- name: Publish package
run: yarn publish
shell: bash
env:
NODE_AUTH_TOKEN: ${{ inputs.node-auth-token }}
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!-- Provide a detailed description of the changes -->

-
-

## 📚 References

Expand Down
6 changes: 6 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
template: |
## What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
88 changes: 88 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: static checks

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
detect-changes:
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
pull-requests: read
outputs:
root: ${{ steps.filter.outputs.root }}
core: ${{ steps.filter.outputs.core }}
v1: ${{ steps.filter.outputs.v1 }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
root:
- '.github/**'
- 'docs/**'
- 'README.md'
core:
- 'packages/core/**'
v1:
- 'packages/v1/**'
check-root:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.root == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: Format
run: yarn run format:dry-run .github docs README.md

check-core:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.core == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/core
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: Compile
run: yarn run compile
- name: Lint
run: yarn run lint:dry-run
- name: Format
run: yarn run format:dry-run
- name: Run tests
run: yarn run test

check-v1:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.v1 == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/v1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: Compile
run: yarn run compile:sdk
- name: Lint
run: yarn run lint:dry-run
- name: Format
run: yarn run format:dry-run
27 changes: 27 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: create a release pr from `develop` to `main`

on:
push:
branches:
- develop

jobs:
create-release-pr:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Create a release PR
env:
GIT_PR_RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_PR_RELEASE_BRANCH_PRODUCTION: main
GIT_PR_RELEASE_BRANCH_STAGING: develop
GIT_PR_RELEASE_TEMPLATE: .github/.git-pr-release
GIT_PR_RELEASE_LABELS: release
TZ: Asia/Tokyo
run: |
gem install -N git-pr-release -v "2.2.0"
git-pr-release --no-fetch
101 changes: 101 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: publish packages to npm registry

on:
push:
branches:
- main
paths:
- 'packages/core/**'
- 'packages/v1/**'

jobs:
detect-changes:
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
pull-requests: read
outputs:
core: ${{ steps.filter.outputs.core }}
v1: ${{ steps.filter.outputs.v1 }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
core:
- 'packages/core/**'
v1:
- 'packages/v1/**'
push-git-tag:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
timeout-minutes: 3
outputs:
tag-name: ${{ 'v' }}${{ env.GIT_TAG_VERSION }}
tag-version: ${{ env.GIT_TAG_VERSION }}
tag-exists: ${{ steps.create-tag.outputs.tag_exists }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- name: get version from `package.json`
run: node -p -e '`GIT_TAG_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- uses: rickstaa/action-create-tag@v1
id: create-tag
with:
tag: ${{ 'v' }}${{ env.GIT_TAG_VERSION }}

publish-release-note:
needs: push-git-tag
if: ${{ needs.push-git-tag.outputs.tag-exists == 'false' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
timeout-minutes: 5
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@v6
with:
name: ${{ needs.push-git-tag.outputs.tag-name }}
tag: ${{ needs.push-git-tag.outputs.tag-name }}
version: ${{ needs.push-git-tag.outputs.tag-version }}
publish: 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-core:
needs: [detect-changes, publish-release-note]
if: ${{ needs.detect-changes.outputs.core == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/core
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- uses: ./.github/actions/publish-package
with:
node-auth-token: ${{ secrets.NPM_TOKEN }}

publish-v1:
needs: [detect-changes, publish-release-note]
if: ${{ needs.detect-changes.outputs.v1 == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/v1
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-dependencies
- uses: ./.github/actions/publish-package
with:
node-auth-token: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Misc
.DS_Store
.vscode
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "packages/v1/JPYCv2"]
path = packages/v1/JPYCv2
url = https://github.com/jcam1/JPYCv2.git
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"quoteProps": "consistent",
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always"
}
Loading

0 comments on commit 797da78

Please sign in to comment.