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

Added GitHub actions #1

Merged
merged 2 commits into from
Oct 2, 2024
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
5 changes: 5 additions & 0 deletions .changeset/angry-cooks-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"changeset-release": minor
---

Added github actions workflow that create release pull request and create github release
5 changes: 5 additions & 0 deletions .changeset/long-bikes-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"changeset-release": minor
---

added quality workflow
91 changes: 91 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Quality

on:
pull_request:
branches:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: pnpm install

- name: Run lint
run: pnpm lint

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: pnpm install

- name: Run format
run: pnpm format

type:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: pnpm install

- name: Run typecheck
run: pnpm typecheck

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: pnpm install

- name: Run build
run: pnpm build
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
pull_request_target:
types:
- closed
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: release

permissions:
contents: write

if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'changeset-release/main')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Setup Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "108yen"

- name: Install dependencies
run: pnpm install

# TODO: created use this package
# - name: Create release
# run: pnpm release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create Release Pull Request

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
version:
name: Create Release Pull Request

permissions:
pull-requests: write
contents: write

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Setup Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "108yen"

- name: Install dependencies
run: pnpm install

- name: Create Pull Request
id: changesets
uses: changesets/action@v1
with:
title: "Update version"
commit: "ci(changesets): update version"
setupGitUser: false
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}