Skip to content

Commit

Permalink
[IDP-1623] Fix release workflow (#11)
Browse files Browse the repository at this point in the history
* [IDP-1623] Fix release branch

* typo

* forgot to checkout

* move action file

* Add name to step
  • Loading branch information
tjosepo authored Jul 4, 2024
1 parent 3c01619 commit 3aaf7db
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 59 deletions.
36 changes: 36 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Setup
description: Setup node, pnpm, and install dependencies

# Pnpm setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm i --frozen-lockfile
shell: bash
35 changes: 4 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,10 @@ jobs:
runs-on: ubuntu-latest

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

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- uses: actions/checkout@v4

- name: Setup project
uses: ./.github/actions/setup

- name: Build packages
run: pnpm build
Expand Down
30 changes: 2 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main

# Pnpm setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
Expand All @@ -20,33 +19,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm i --frozen-lockfile
- name: Setup project
uses: ./.github/actions/setup

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down

0 comments on commit 3aaf7db

Please sign in to comment.