Skip to content

Commit

Permalink
add release GitHub action + extract common setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
VenomAV committed Oct 18, 2024
1 parent 53e8d56 commit 0a31535
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup
description: Perform standard setup and install dependencies using pnpm.
inputs:
node-version:
description: The version of Node.js to install
required: true
default: 20.14.0

runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install node
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: ${{ inputs.node-version }}
- name: Install dependencies
shell: bash
run: pnpm install
12 changes: 2 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"

- name: Install packages
run: pnpm install --frozen-lockfile
- name: Install dependencies
uses: ./.github/actions/setup

- name: Build
run: |
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
push:
branches: [main]

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

permissions: {}

jobs:
release:
if: github.repository_owner == 'doubleloop-io'
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/setup
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
version: pnpm changeset-version
publish: pnpm changeset-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 0a31535

Please sign in to comment.