Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,32 @@ concurrency:

env:
CI: true
CACHE_PREFIX: stable
NODE_VERSION: 22

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"

- name: Use cached node_modules
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ env.CACHE_PREFIX }}-node_modules-${{ hashFiles('**/package-lock.json') }}
cache: pnpm

- name: Install dependencies
run: npm install --force
run: pnpm install

- name: Check formatting
run: npm run format -- --check
run: pnpm run format --check

- name: Build Prettier Plugin
run: |
npm run build
run: pnpm run build

- name: Test against Prettier v3
run: |
NODE_OPTIONS=--experimental-vm-modules npm run test
run: pnpm run test
30 changes: 17 additions & 13 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
CI: true
NODE_VERSION: 22

permissions:
contents: read
Expand All @@ -19,12 +20,8 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- run: git fetch --tags -f

Expand All @@ -33,21 +30,28 @@ jobs:
run: |
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Get release notes
run: |
RELEASE_NOTES=$(npm run release-notes --silent)
RELEASE_NOTES=$(pnpm run release-notes --silent)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ env.TAG_NAME }}
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/release-insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ concurrency:

env:
CI: true
CACHE_PREFIX: stable
NODE_VERSION: 22
RELEASE_CHANNEL: insiders

Expand All @@ -22,41 +21,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
registry-url: "https://registry.npmjs.org"

- name: Use cached node_modules
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ env.CACHE_PREFIX }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm install
run: pnpm install

- name: Build Prettier Plugin
run: |
npm run build
run: pnpm run build

- name: Test
run: |
NODE_OPTIONS=--experimental-vm-modules npm run test
run: pnpm run test

- name: Resolve version
id: vars
run: |
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: "Version based on commit: 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }}"
run: npm version 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }} --force --no-git-tag-version
run: pnpm version 0.0.0-${{ env.RELEASE_CHANNEL }}.${{ env.SHA_SHORT }} --force --no-git-tag-version

- name: Publish
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
run: pnpm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 11 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,39 @@ concurrency:

env:
CI: true
CACHE_PREFIX: stable
NODE_VERSION: 22

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
registry-url: "https://registry.npmjs.org"

- name: Use cached node_modules
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ env.CACHE_PREFIX }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm install
run: pnpm install

- name: Build Prettier Plugin
run: |
npm run build
run: pnpm run build

- name: Test
run: |
NODE_OPTIONS=--experimental-vm-modules npm run test
run: pnpm run test

- name: Calculate environment variables
run: |
echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV
echo "RELEASE_CHANNEL=$(pnpm run release-channel --silent)" >> $GITHUB_ENV

- name: Publish
run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }}
run: pnpm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading