Skip to content

Commit 7392f0f

Browse files
authored
ci: create ci-build-all-pm.yml (#400)
* ci: create `ci-build-all-pm.yml` * wip
1 parent c685139 commit 7392f0f

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed

.github/workflows/ci-build-all-pm.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: CI Build install
2+
# This workflow creates a tarball from repo sources
3+
# It then checks that each of the following package managers is able to install:
4+
# - npm
5+
# - Yarn v1 Classic
6+
# - Yarn (Modern)
7+
# - pnpm
8+
# - bun
9+
on:
10+
push:
11+
branches:
12+
- main
13+
pull_request:
14+
branches:
15+
- main
16+
workflow_dispatch:
17+
jobs:
18+
npm-build:
19+
name: Build tarball
20+
runs-on: ubuntu-latest
21+
outputs:
22+
version: ${{ steps.get_version.outputs.version }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "lts/*"
29+
- run: npm install
30+
- run: npm pack
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: build
34+
path: eslint-markdown-*.tgz
35+
retention-days: 1
36+
- name: Get version
37+
id: get_version
38+
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
39+
npm-install:
40+
name: Install with npm
41+
needs: npm-build
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/download-artifact@v4
45+
with:
46+
name: build
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: "lts/*"
51+
- name: npm install
52+
run: |
53+
npm install ./eslint-markdown-${{ needs.npm-build.outputs.version }}.tgz -D
54+
yarn-v1-install:
55+
name: Install with Yarn v1
56+
needs: npm-build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/download-artifact@v4
60+
with:
61+
name: build
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: "lts/*"
66+
- name: yarn add
67+
run: |
68+
yarn add ./eslint-markdown-${{ needs.npm-build.outputs.version }}.tgz -D
69+
yarn-install:
70+
name: Install with Yarn
71+
needs: npm-build
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/download-artifact@v4
75+
with:
76+
name: build
77+
- name: Setup Node.js
78+
uses: actions/setup-node@v4
79+
with:
80+
node-version: "lts/*"
81+
- name: Install Corepack latest
82+
run: |
83+
npm install -g corepack@latest
84+
corepack enable yarn
85+
- name: yarn add
86+
run: |
87+
corepack use yarn@latest
88+
yarn init -p
89+
yarn add ./eslint-markdown-${{ needs.npm-build.outputs.version }}.tgz -D
90+
env:
91+
YARN_ENABLE_IMMUTABLE_INSTALLS: 0 # Allow installs to modify lockfile
92+
pnpm-install:
93+
name: Install with pnpm
94+
needs: npm-build
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/download-artifact@v4
98+
with:
99+
name: build
100+
- name: Install pnpm
101+
uses: pnpm/action-setup@v4
102+
with:
103+
version: latest
104+
- name: Setup Node.js
105+
uses: actions/setup-node@v4
106+
with:
107+
node-version: "lts/*"
108+
- name: pnpm add
109+
run: |
110+
cat > .npmrc <<EOT
111+
auto-install-peers=true
112+
node-linker=hoisted
113+
EOT
114+
pnpm add ./eslint-markdown-${{ needs.npm-build.outputs.version }}.tgz -D
115+
bun-install:
116+
name: Install with bun
117+
needs: npm-build
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/download-artifact@v4
121+
with:
122+
name: build
123+
- name: Setup Node.js
124+
uses: actions/setup-node@v4
125+
with:
126+
node-version: "lts/*"
127+
- name: setup bun
128+
uses: oven-sh/setup-bun@v2
129+
- name: bun install
130+
run: |
131+
bun install ./eslint-markdown-${{ needs.npm-build.outputs.version }}.tgz -D

0 commit comments

Comments
 (0)