Skip to content

Commit c68bc3e

Browse files
authored
ci: fix release using raw uses (#46)
* ci: fix using raw uses * ci(release): fix relative paths * ci(release): change pnpm-install path
1 parent b6ad53e commit c68bc3e

File tree

4 files changed

+263
-15
lines changed

4 files changed

+263
-15
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "pnpm install"
2+
description: "Run pnpm install with cache enabled"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up swap space
7+
if: runner.os == 'Linux'
8+
uses: pierotofy/set-swap-space@v1.0
9+
with:
10+
swap-size-gb: 10
11+
12+
- uses: pnpm/action-setup@v4.1.0
13+
name: Install pnpm
14+
with:
15+
run_install: false
16+
17+
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
18+
id: pnpm-config
19+
shell: bash
20+
run: |
21+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
22+
23+
- name: Cache rotation keys
24+
id: cache-rotation
25+
shell: bash
26+
run: |
27+
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
28+
29+
- uses: actions/cache@v4
30+
name: Setup pnpm cache
31+
with:
32+
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
33+
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
34+
restore-keys: |
35+
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
36+
37+
- name: Install dependencies
38+
shell: bash
39+
run: |
40+
pnpm install --frozen-lockfile --prefer-offline --loglevel error
41+
env:
42+
HUSKY: "0"

.github/workflows/release.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,18 @@ jobs:
2727
package-manager-cache: false
2828
registry-url: https://registry.npmjs.org/
2929

30-
- name: Install actions
31-
id: actions
32-
shell: bash
33-
run: |
34-
npm install -g @nanoforge-dev/actions && echo "ACTIONS_PATH=$(npm ls -gp @nanoforge-dev/actions)" >> $GITHUB_OUTPUT
35-
3630
- name: Install dependencies
37-
uses: jenseng/dynamic-uses@v1
38-
with:
39-
uses: ${{ steps.actions.outputs.ACTIONS_PATH }}/dist/pnpm-install
31+
uses: ./.github/actions/pnpm-install
4032

4133
- name: Build dependencies
4234
run: pnpm run build
4335

4436
- name: Release packages
45-
uses: jenseng/dynamic-uses@v1
37+
uses: ./node_modules/@nanoforge-dev/actions/dist/release-packages
4638
with:
47-
uses: ${{ steps.actions.outputs.ACTIONS_PATH }}/dist/release-packages
48-
with: |
49-
package: "@nanoforge-dev/schematics"
50-
exclude: ""
51-
dry: ${{ inputs.dry_run }}
39+
package: "@nanoforge-dev/schematics"
40+
exclude: ""
41+
dry: ${{ inputs.dry_run }}
5242
env:
5343
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
5444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"@commitlint/config-conventional": "^20.0.0",
6767
"@eslint/js": "^9.39.0",
6868
"@favware/cliff-jumper": "^6.0.0",
69+
"@nanoforge-dev/actions": "^1.0.2",
6970
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
7071
"@types/node": "^24.10.1",
7172
"@typescript-eslint/eslint-plugin": "^8.46.2",

0 commit comments

Comments
 (0)