Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package 公開する Workflow 作成 #7

Merged
merged 3 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Node.js Package

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
registry-url: 'https://npm.pkg.github.com'
scope: '@saitamau-maximum'
always-auth: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Test
run: pnpm format:check && pnpm lint && pnpm build

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8.6.2

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
registry-url: 'https://npm.pkg.github.com'
scope: '@saitamau-maximum'
always-auth: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build
run: pnpm build

- name: Publish to GitHub Packages
run: pnpm publish
working-directory: packages/components
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ FontをHeadで読み込んでください、推奨は`Noto Sans JP`です。
<!-- ダークモードの場合 -->
</html>
```

Package のインストールをするには、 `~/.npmrc` に以下を追加してください。

```npmrc
@saitamau-maximum:registry=https://npm.pkg.github.com
```
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "maximum-ui",
"name": "@saitamau-maximum/ui",
"version": "0.0.0",
"type": "module",
"sideEffects": false,
Expand Down