Skip to content

Commit d04402b

Browse files
committed
Merge branch 'release/v0.0.11'
2 parents acb12b6 + 4493c65 commit d04402b

12,249 files changed

Lines changed: 196391 additions & 5033 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

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

.github/workflows/check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and Test
2+
3+
on:
4+
- push
5+
- deployment
6+
- pull_request
7+
- workflow_call
8+
9+
jobs:
10+
check:
11+
name: Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: latest
19+
- name: Install Dependencies
20+
run: npm clean-install
21+
- name: Build
22+
run: npm run build
23+
- name: Lint
24+
run: npm run lint
25+
- name: Test
26+
run: npm test

.github/workflows/deployment.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
prepare:
11+
name: Prepare
12+
runs-on: ubuntu-latest
13+
outputs:
14+
heading-pattern: ${{ steps.escape-tag-name.outputs.heading-pattern }}
15+
steps:
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
- id: escape-tag-name
19+
name: Escape Tag Name
20+
run: |
21+
npm install @stdlib/utils-escape-regexp-string --no-save
22+
pattern="$(node -e "console.log(require('@stdlib/utils-escape-regexp-string')('${{ github.ref_name }}'))")"
23+
echo "heading-pattern=/^## \(.* \(${pattern}\|\[${pattern}\]\)\)\$/" >> $GITHUB_OUTPUT
24+
prerequisites:
25+
name: Verify Prerequisites
26+
uses: ./.github/workflows/prerequisites.yml
27+
secrets:
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }}
30+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
31+
collect-changelog:
32+
name: Collect Release Notes
33+
runs-on: ubuntu-latest
34+
needs:
35+
- prepare
36+
- prerequisites
37+
outputs:
38+
title: ${{ steps.release-info.outputs.title }}
39+
notes: ${{ steps.release-info.outputs.notes }}
40+
env:
41+
CURRENT_PATTERN: ${{ needs.prepare.outputs.heading-pattern }}
42+
ANY_PATTERN: /^## \(.* \(v[0-9]*\|\[.*\]\)\)/
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Detect Current Changelog Entries
46+
run: '[ ! -z "$(sed "${CURRENT_PATTERN}p;d" CHANGELOG.md)" ] || { echo "No Changelog Entries Found!" && false; }'
47+
- id: release-info
48+
name: Collect Release Info
49+
run: |
50+
notes="$(sed "1,${CURRENT_PATTERN}{ ${CURRENT_PATTERN}P ; d } ; ${ANY_PATTERN},\$d" CHANGELOG.md)"
51+
title="$(echo "$notes" | sed "2,\$d ; s${ANY_PATTERN}\1/")"
52+
echo "title=$title" >> $GITHUB_OUTPUT
53+
{
54+
echo "notes<<EOF"
55+
echo "$notes"
56+
echo EOF
57+
} >> $GITHUB_OUTPUT
58+
publish-npm:
59+
name: Publish Package to NPM
60+
uses: ./.github/workflows/npm-publish.yml
61+
if: github.event_name == 'workflow_dispatch'
62+
needs:
63+
- collect-changelog
64+
publish-gh:
65+
name: Publish Package to GitHub Registry
66+
uses: ./.github/workflows/npm-publish.yml
67+
if: github.event_name == 'workflow_dispatch'
68+
permissions:
69+
packages: write
70+
needs:
71+
- collect-changelog
72+
with:
73+
registry: https://npm.pkg.github.com
74+
release:
75+
name: Create Release on GitHub
76+
runs-on: ubuntu-latest
77+
if: github.event_name == 'workflow_dispatch'
78+
needs:
79+
- collect-changelog
80+
steps:
81+
- uses: actions/checkout@v4
82+
- name: Install Dependencies
83+
run: npm clean-install
84+
- name: Create NPM Packages
85+
run: npm pack -w @typescript-nameof/nameof @typescript-nameof/types @typescript-nameof/babel @typescript-nameof/common @typescript-nameof/common-types
86+
- name: Create `vscode` Extension
87+
run: |
88+
npm exec --workspace ./packages/vscode -- vsce package
89+
npm run --prefix ./packages/vscode vscode:postpublish
90+
- name: Create Release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
name: ${{ needs.collect-changelog.outputs.title }}
94+
body: ${{ needs.collect-changelog.outputs.notes }}
95+
files: |
96+
*.tgz
97+
packages/vscode/*.vsix

.github/workflows/npm-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Package to NPM Registry
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
registry:
7+
type: string
8+
description: The URL of the NPM package registry to verify the authentication for
9+
default: https://registry.npmjs.org
10+
secrets:
11+
npmToken:
12+
description: The Personal Access Token for authenticating to the NPM package repository
13+
required: true
14+
15+
jobs:
16+
publish:
17+
name: Publish to NPM Package Registry
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set Up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: latest
25+
registry-url: ${{ inputs.registry }}
26+
- name: Install Dependencies
27+
run: npm clean-install
28+
- name: Publish to NPM Package Registry
29+
run: npm publish --workspaces
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.npmToken }}

.github/workflows/npm-token.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Verify NPM Access Token
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
registry:
7+
type: string
8+
description: The URL of the NPM package registry to verify the authentication for
9+
default: https://registry.npmjs.org
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
name: Verify Access Token
19+
steps:
20+
- name: Set Up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
registry-url: ${{ inputs.registry }}
24+
- name: Verify NPM Access Token
25+
run: npm whoami || { echo "The NPM Access Token is invalid!" && false; }
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Verify Prerequisites
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
NPM_TOKEN:
7+
description: The token for accessing the NPM registry.
8+
required: true
9+
OVSX_TOKEN:
10+
description: The token for accessing Open VSX.
11+
required: true
12+
VSCE_TOKEN:
13+
description: The token for accessing the Visual Studio Marketplace.
14+
required: true
15+
16+
jobs:
17+
check:
18+
name: Check
19+
uses: ./.github/workflows/check.yml
20+
prepare:
21+
name: Prepare
22+
runs-on: ubuntu-latest
23+
outputs:
24+
publisher: ${{ steps.fetch-publisher.outputs.publisher }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
29+
- id: fetch-publisher
30+
name: Determining Publisher Name
31+
run: echo "publisher=$(node -e "console.log(JSON.parse(require('fs').readFileSync('./packages/vscode/package.json').toString()).publisher)")" >> $GITHUB_OUTPUT
32+
check-npm-token:
33+
name: Verify NPM Access Token
34+
uses: ./.github/workflows/npm-token.yml
35+
check-marketplace-tokens:
36+
runs-on: ubuntu-latest
37+
name: Verify Marketplace Tokens
38+
needs:
39+
- prepare
40+
env:
41+
PUBLISHER: ${{ needs.prepare.outputs.publisher }}
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Install Node.js
45+
uses: actions/setup-node@v4
46+
- name: Install Dependencies
47+
run: npm install
48+
- name: Verify Open VSX Token
49+
run: |
50+
verifyOVSX() {
51+
url='https://open-vsx.org/api/-/namespace/create?token='"$1"
52+
output=$(curl -X POST $url --header 'Content-Type: application/json' --data-raw '{ "name": "'"$PUBLISHER"'" }')
53+
node -e 'JSON.parse('"'$output'"').error?.includes("Invalid access token") && process.exit(1);'
54+
}
55+
56+
verifyOVSX ${{ secrets.OVSX_TOKEN }} || { echo "The Open VSX Token is invalid!" && false; }
57+
- name: Verify Visual Studio Marketplace Token
58+
run: |
59+
verifyVSCE() {
60+
npx vsce verify-pat $PUBLISHER --pat $1 > /dev/null 2>&1
61+
}
62+
63+
verifyVSCE ${{ secrets.VSCE_TOKEN }} || { echo "The Visual Studio Marketplace Token is invalid!" && false; }

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,3 @@ dist
122122

123123
# TernJS port file
124124
.tern-port
125-
126-
# Temporary release-assets
127-
.tagName.txt
128-
.tagHeading.txt
129-
.releaseNotes.md
130-
.releaseTitle.md

.woodpecker/.check.yml

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

0 commit comments

Comments
 (0)