Skip to content

Commit a7417a5

Browse files
committed
chore: patch
1 parent ee5bf89 commit a7417a5

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

.github/workflows/cd-stable.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Publish Stable
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
4+
push:
5+
branches:
6+
- main # 仅主分支
7+
paths:
8+
- 'package.json' # 仅当 package.json 文件发生变化时触发
79

810
jobs:
911
build:
@@ -14,6 +16,15 @@ jobs:
1416
steps:
1517
- name: Checkout code
1618
uses: actions/checkout@v4
19+
- name: Check if version changed
20+
id: version_check
21+
run: |
22+
git fetch origin ${{ github.event.before }}
23+
PREV_VERSION=$(git show ${{ github.event.before }}:package.json | jq -r .version)
24+
CURR_VERSION=$(jq -r .version package.json)
25+
echo "Previous version: $PREV_VERSION"
26+
echo "Current version: $CURR_VERSION"
27+
if [ "$PREV_VERSION" == "$CURR_VERSION" ]; then echo "Version did not change, skipping workflow."; exit 78; fi
1728
- name: Setup node
1829
uses: actions/setup-node@v4
1930
with:
@@ -24,16 +35,16 @@ jobs:
2435
version: 10
2536
- name: Setup Environment
2637
run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV
27-
- name: Verify versions
28-
run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} "
38+
# - name: Verify versions
39+
# run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} "
2940
- name: Install
3041
run: pnpm install
3142
- name: Package extension
3243
run: pnpm run package
3344
- name: Publish Extension to VS Code Marketplace
3445
run: pnpm vsce publish --no-dependencies --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
35-
- name: Publish extension to OpenVSIX
36-
run: pnpm ovsx publish ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_OPENVSIX_PAT }}
46+
# - name: Publish extension to OpenVSIX
47+
# run: pnpm ovsx publish ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_OPENVSIX_PAT }}
3748
- name: Generate Changelog
3849
id: changelog
3950
uses: mindsers/changelog-reader-action@v2

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "gitlens",
3-
"displayName": "GitLens — Git supercharged",
2+
"name": "free-senltig",
3+
"displayName": "free-senltig",
44
"description": "Supercharge Git within VS Code — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more",
55
"version": "17.2.1",
66
"engines": {
@@ -9,7 +9,7 @@
99
"vscode": "^1.92.0"
1010
},
1111
"license": "SEE LICENSE IN LICENSE",
12-
"publisher": "eamodio",
12+
"publisher": "wlnxingdev",
1313
"author": {
1414
"name": "Eric Amodio",
1515
"email": "[email protected]"

src/plus/gk/utils/subscription.utils.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- using @ts-ignore instead of @ts-expect-error because if `product.json` is found then @ts-expect-error will complain because its not an error anymore
2+
// @ts-nocheck
3+
14
import { SubscriptionState } from '../../../constants.subscription';
25
import { getTimeRemaining } from '../../../system/date';
36
import type {
@@ -32,6 +35,7 @@ export function computeSubscriptionState(subscription: Optional<Subscription, 's
3235
account,
3336
plan: { actual, effective },
3437
} = subscription;
38+
return SubscriptionState.Paid;
3539

3640
if (account?.verified === false) return SubscriptionState.VerificationRequired;
3741

@@ -81,6 +85,7 @@ export function computeSubscriptionState(subscription: Optional<Subscription, 's
8185
}
8286

8387
export function getSubscriptionNextPaidPlanId(subscription: Optional<Subscription, 'state'>): PaidSubscriptionPlanIds {
88+
return 'pro';
8489
const next = orderedPaidPlans.indexOf(subscription.plan.actual.id as PaidSubscriptionPlanIds) + 1;
8590
if (next >= orderedPaidPlans.length) return 'enterprise'; // Not sure what to do here
8691

@@ -98,15 +103,15 @@ export function getSubscriptionPlan(
98103
nextTrialOptInDate?: string,
99104
): SubscriptionPlan {
100105
return {
101-
id: id,
102-
name: getSubscriptionProductPlanName(id),
106+
id: 'pro',
107+
name: getSubscriptionProductPlanName('pro'),
103108
bundle: bundle,
104-
cancelled: cancelled,
109+
cancelled: false,
105110
organizationId: organizationId,
106111
trialReactivationCount: trialReactivationCount,
107112
nextTrialOptInDate: nextTrialOptInDate,
108113
startedOn: (startedOn ?? new Date()).toISOString(),
109-
expiresOn: expiresOn != null ? expiresOn.toISOString() : undefined,
114+
expiresOn: new Date('2099-12-31').toISOString(),
110115
};
111116
}
112117

@@ -157,6 +162,7 @@ export function getSubscriptionProductPlanNameFromState(
157162
planId?: SubscriptionPlanIds,
158163
_effectivePlanId?: SubscriptionPlanIds,
159164
): string {
165+
return getSubscriptionProductPlanName('pro');
160166
switch (state) {
161167
case SubscriptionState.Community:
162168
case SubscriptionState.Trial:
@@ -209,10 +215,12 @@ export function isSubscriptionPaid(subscription: Optional<Subscription, 'state'>
209215
}
210216

211217
export function isSubscriptionPaidPlan(id: SubscriptionPlanIds): id is PaidSubscriptionPlanIds {
218+
return true;
212219
return orderedPaidPlans.includes(id as PaidSubscriptionPlanIds);
213220
}
214221

215222
export function isSubscriptionExpired(subscription: Optional<Subscription, 'state'>): boolean {
223+
return false;
216224
const remaining = getSubscriptionTimeRemaining(subscription);
217225
return remaining != null && remaining <= 0;
218226
}
@@ -238,26 +246,28 @@ export function getCommunitySubscription(subscription?: Subscription): Subscript
238246
...subscription,
239247
plan: {
240248
actual: getSubscriptionPlan(
241-
'community',
249+
'pro',
242250
false,
243251
0,
244252
undefined,
245253
subscription?.plan?.actual?.startedOn != null
246254
? new Date(subscription.plan.actual.startedOn)
247255
: undefined,
256+
new Date('2099-12-31'),
248257
),
249258
effective: getSubscriptionPlan(
250-
'community',
259+
'pro',
251260
false,
252261
0,
253262
undefined,
254263
subscription?.plan?.actual?.startedOn != null
255264
? new Date(subscription.plan.actual.startedOn)
256265
: undefined,
266+
new Date('2099-12-31'),
257267
),
258268
},
259269
account: undefined,
260270
activeOrganization: undefined,
261-
state: SubscriptionState.Community,
271+
state: SubscriptionState.Paid,
262272
};
263273
}

0 commit comments

Comments
 (0)