Skip to content

Commit

Permalink
ci: Fix workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryohidaka committed Sep 12, 2024
1 parent 47931e6 commit 657b121
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build

- name: Run test
run: npm test
4 changes: 0 additions & 4 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ permissions:
jobs:
dependabot-auto-merge:
runs-on: ubuntu-latest

if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- name: Dependabot metadata
id: metadata

uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs

if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Release

on:
pull_request:
branches:
- main
types:
- closed
workflow_run:
workflows: [Bump Patch Version]
types:
- completed

jobs:
publish:
Expand All @@ -16,12 +14,21 @@ jobs:
github.event_name == 'workflow_run'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- run: npm ci
- run: npm run build
- uses: JS-DevTools/npm-publish@v2

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Publish to npm
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}

0 comments on commit 657b121

Please sign in to comment.