Skip to content

Commit e8acfd6

Browse files
authored
Upgrade Release flow (#634)
* Migrate package manager to pnpm form yarn * Init changeset * Add .node-version file with version 20 * Add setup actions and migrate ci package manager to pnpm * Add @actions/exec to dependencies * chore: Migrate package manager from pnpm to yarn technote-space/release-github-actions dosen't support pnpm * Add changeset * Update workflow.yaml for versioning
1 parent 895205c commit e8acfd6

File tree

8 files changed

+1376
-401
lines changed

8 files changed

+1376
-401
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "ts-graphviz/setup-graphviz"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "restricted",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}

.changeset/tasty-rats-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"setup-graphviz": patch
3+
---
4+
5+
Upgrade Release flow by using changeset

.github/actions/setup/action.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Setup Action
2+
description: |
3+
Setup Node.js and yarn.
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Setup Node.js
9+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
10+
with:
11+
node-version-file: ./.node-version
12+
cache: yarn
13+
- name: Get yarn cache directory path
14+
id: yarn-cache-dir-path
15+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
16+
shell: bash
17+
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
18+
name: Setup yarn cache
19+
with:
20+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
21+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-yarn-
24+
- name: Install Dependencies
25+
run: yarn install --frozen-lockfile
26+
shell: bash

.github/workflows/workflow.yaml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
10-
- name: Set Node.js 20.x
11-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
12-
with:
13-
node-version: 20.x
14-
cache: yarn
15-
- name: Install Dependencies
16-
run: yarn install --frozen-lockfile
9+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
10+
- name: Setup
11+
uses: ./.github/actions/setup
1712
- name: Lint
1813
run: yarn lint
1914
- name: TypeCheck
@@ -24,34 +19,24 @@ jobs:
2419
runs-on: ubuntu-latest
2520
needs: check
2621
steps:
27-
- name: Checkout
28-
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
29-
- name: Set Node.js 20.x
30-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
31-
with:
32-
node-version: 20.x
33-
cache: yarn
34-
- name: Install Dependencies
35-
run: yarn install --frozen-lockfile
36-
- name: Test
37-
run: yarn test
38-
- name: Build
39-
run: yarn build
22+
- name: Checkout
23+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24+
- name: Setup
25+
uses: ./.github/actions/setup
26+
- name: Test
27+
run: yarn test
28+
- name: Build
29+
run: yarn build
4030

4131
build:
4232
name: Build
4333
runs-on: ubuntu-latest
4434
needs: check
4535
steps:
4636
- name: Checkout
47-
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
48-
- name: Set Node.js 20.x
49-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
50-
with:
51-
node-version: 20.x
52-
cache: yarn
53-
- name: Install Dependencies
54-
run: yarn install --frozen-lockfile
37+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
38+
- name: Setup
39+
uses: ./.github/actions/setup
5540
- name: Build
5641
run: yarn build
5742
- name: Upload Artifact
@@ -72,17 +57,32 @@ jobs:
7257
os: [ubuntu-latest, windows-latest, macos-latest]
7358
steps:
7459
- name: Checkout
75-
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
76-
- name: Set Node.js 20.x
77-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
78-
with:
79-
node-version: 20.x
80-
cache: yarn
81-
- name: Install Dependencies
82-
run: yarn install --frozen-lockfile
60+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
61+
- name: Setup
62+
uses: ./.github/actions/setup
8363
- name: Download Artifact
8464
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
8565
- name: Run Integration Tests
8666
uses: ./
8767
- name: Graphviz test
8868
run: dot -V
69+
70+
versioning:
71+
name: Versioning
72+
runs-on: ubuntu-latest
73+
needs:
74+
- integration-test
75+
permissions:
76+
contents: write # Used to commit to "Version Packages" PR
77+
pull-requests: write # Used to create "Version Packages" PR
78+
if: ${{ github.event_name == 'push' && github.repository == 'ts-graphviz/setup-graphviz' && github.base_ref == 'refs/heads/main' }}
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
82+
- name: Setup
83+
uses: ./.github/actions/setup
84+
- name: Create Release Pull Request
85+
id: changesets
86+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
},
2020
"dependencies": {
2121
"@actions/core": "^1.2.6",
22+
"@actions/exec": "^1.1.1",
2223
"@actions/tool-cache": "^2.0.1"
2324
},
2425
"devDependencies": {
2526
"@biomejs/biome": "^1.7.1",
27+
"@changesets/changelog-github": "^0.5.0",
28+
"@changesets/cli": "^2.27.6",
2629
"@types/node": "^20.12.7",
2730
"typescript": "^5.4.5",
2831
"vitest": "^1.5.0"
29-
}
32+
},
33+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
3034
}

0 commit comments

Comments
 (0)