Skip to content

Commit

Permalink
Merge pull request #28 from nemuvski/issue-27
Browse files Browse the repository at this point in the history
利用しているGitHub Actionsのバージョンアップ等
  • Loading branch information
nemuvski authored Jan 31, 2024
2 parents fd1c5e2 + 0fdbd5c commit 1f7cb69
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 52 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/code-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,32 @@ name: Code Check
on:
push:
tags-ignore:
- '*'
- "*"
branches: [main]
paths-ignore:
- '**.md'
- "**.md"
pull_request:
types: [opened, synchronize, reopened]

env:
PNPM_VERSION: 8.6.5

jobs:
code-check:
name: Code Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
node-version-file: ".node-version"

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Set up pnpm
id: pnpm-setup
run: corepack enable
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand Down
65 changes: 28 additions & 37 deletions .github/workflows/latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ on:
release:
types: [released]

env:
PNPM_VERSION: 8.6.5

jobs:
release-utils:
name: 'Latest release @itsumono/utils'
name: "Latest release @itsumono/utils"
# Do not run if the release is a prerelease or draft
# @see https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#release
if: ${{ startsWith(github.event.release.tag_name, 'utils@') && github.event.release.prerelease == false && github.event.release.draft == false }}
Expand All @@ -20,31 +17,28 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
node-version-file: ".node-version"
registry-url: "https://registry.npmjs.org"

- name: Current Node.js version
id: current-node-version
shell: bash
run: |
echo "BUILD_NODE_VERSION=$(node -v | sed 's/^v//i')" >> $GITHUB_OUTPUT
# Install pnpm
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
# Set up pnpm
- name: Set up pnpm
id: pnpm-setup
run: corepack enable
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -55,19 +49,19 @@ jobs:
# Install dependencies
- name: Cache restore dependencies
id: cache-restore-dependencies
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: '**/node_modules'
path: "**/node_modules"
key: ${{ runner.os }}-node${{ steps.current-node-version.outputs.BUILD_NODE_VERSION }}-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.cache-restore-dependencies.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile --reporter=silent
- name: Cache save dependencies
if: steps.cache-restore-dependencies.outputs.cache-hit != 'true'
id: cache-save-dependencies
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: '**/node_modules'
path: "**/node_modules"
key: ${{ runner.os }}-node${{ steps.current-node-version.outputs.BUILD_NODE_VERSION }}-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}

# Build and Deploy
Expand All @@ -82,7 +76,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release-react:
name: 'Latest release @itsumono/react'
name: "Latest release @itsumono/react"
# Do not run if the release is a prerelease or draft
# @see https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#release
if: ${{ startsWith(github.event.release.tag_name, 'react@') && github.event.release.prerelease == false && github.event.release.draft == false }}
Expand All @@ -91,31 +85,28 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
node-version-file: ".node-version"
registry-url: "https://registry.npmjs.org"

- name: Current Node.js version
id: current-node-version
shell: bash
run: |
echo "BUILD_NODE_VERSION=$(node -v | sed 's/^v//i')" >> $GITHUB_OUTPUT
# Install pnpm
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
# Set up pnpm
- name: Set up pnpm
id: pnpm-setup
run: corepack enable
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -126,19 +117,19 @@ jobs:
# Install dependencies
- name: Cache restore dependencies
id: cache-restore-dependencies
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: '**/node_modules'
path: "**/node_modules"
key: ${{ runner.os }}-node${{ steps.current-node-version.outputs.BUILD_NODE_VERSION }}-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.cache-restore-dependencies.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile --reporter=silent
- name: Cache save dependencies
if: steps.cache-restore-dependencies.outputs.cache-hit != 'true'
id: cache-save-dependencies
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: '**/node_modules'
path: "**/node_modules"
key: ${{ runner.os }}-node${{ steps.current-node-version.outputs.BUILD_NODE_VERSION }}-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}

# Build and Deploy
Expand Down

0 comments on commit 1f7cb69

Please sign in to comment.