Skip to content

Commit 0a31535

Browse files
committed
add release GitHub action + extract common setup action
1 parent 53e8d56 commit 0a31535

File tree

3 files changed

+55
-10
lines changed

3 files changed

+55
-10
lines changed

.github/actions/setup/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Setup
2+
description: Perform standard setup and install dependencies using pnpm.
3+
inputs:
4+
node-version:
5+
description: The version of Node.js to install
6+
required: true
7+
default: 20.14.0
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v3
14+
- name: Install node
15+
uses: actions/setup-node@v4
16+
with:
17+
cache: pnpm
18+
node-version: ${{ inputs.node-version }}
19+
- name: Install dependencies
20+
shell: bash
21+
run: pnpm install

.github/workflows/ci.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,9 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
20-
- name: Install pnpm
21-
uses: pnpm/action-setup@v4
2220

23-
- name: Install node
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: "20"
27-
cache: "pnpm"
28-
29-
- name: Install packages
30-
run: pnpm install --frozen-lockfile
21+
- name: Install dependencies
22+
uses: ./.github/actions/setup
3123

3224
- name: Build
3325
run: |

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions: {}
10+
11+
jobs:
12+
release:
13+
if: github.repository_owner == 'doubleloop-io'
14+
name: Release
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 30
17+
permissions:
18+
contents: write
19+
id-token: write
20+
pull-requests: write
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Install dependencies
24+
uses: ./.github/actions/setup
25+
- name: Create Release Pull Request or Publish
26+
uses: changesets/action@v1
27+
with:
28+
version: pnpm changeset-version
29+
publish: pnpm changeset-publish
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)