Skip to content

Commit 9a51191

Browse files
committed
merge release.yml and release-insiders.yml
1 parent 3997fbd commit 9a51191

2 files changed

Lines changed: 26 additions & 65 deletions

File tree

.github/workflows/release-insiders.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches: [main]
6+
tags:
7+
- 'v*'
68

79
permissions:
810
contents: read
@@ -14,7 +16,7 @@ concurrency:
1416

1517
env:
1618
CI: true
17-
NODE_VERSION: 22
19+
NODE_VERSION: 24
1820

1921
jobs:
2022
build:
@@ -23,6 +25,19 @@ jobs:
2325
steps:
2426
- uses: actions/checkout@v4
2527

28+
- name: Resolve version
29+
run: |
30+
SHA_SHORT=$(git rev-parse --short HEAD)
31+
echo "SHA_SHORT=$SHA_SHORT" >> $GITHUB_ENV
32+
33+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
34+
VERSION=${GITHUB_REF#refs/tags/v}
35+
else
36+
VERSION=0.0.0-insiders.$SHA_SHORT
37+
fi
38+
39+
echo "VERSION=$VERSION" >> $GITHUB_ENV
40+
2641
- name: Install pnpm
2742
uses: pnpm/action-setup@v4
2843

@@ -36,17 +51,19 @@ jobs:
3651
- name: Install dependencies
3752
run: pnpm install
3853

54+
- name: Calculate environment variables
55+
run: |
56+
echo "RELEASE_CHANNEL=$(node ./scripts/release-channel.js $VERSION)" >> $GITHUB_ENV
57+
58+
- name: Version package for insiders release
59+
if: github.ref_type != 'tag'
60+
run: pnpm version ${{ env.VERSION }} --force --no-git-tag-version
61+
3962
- name: Build Prettier Plugin
4063
run: pnpm run build
4164

4265
- name: Test
4366
run: pnpm run test
4467

45-
- name: Calculate environment variables
46-
run: |
47-
echo "RELEASE_CHANNEL=$(pnpm run release-channel --silent)" >> $GITHUB_ENV
48-
4968
- name: Publish
5069
run: pnpm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} --no-git-checks
51-
env:
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)