Skip to content

Commit 21f46b7

Browse files
Merge pull request #4 from cursorless-dev/deployWorkflow
Added deploy workflow
2 parents e9144ca + 59fa9d9 commit 21f46b7

9 files changed

Lines changed: 65 additions & 9 deletions

.github/workflows/deploy.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: [Test]
6+
types: [completed]
7+
branches: [main]
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
13+
jobs:
14+
publish-npm:
15+
name: Publish to NPM
16+
runs-on: ubuntu-latest
17+
environment: production
18+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
23+
with:
24+
ref: ${{ github.event.workflow_run.head_sha }}
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v6
28+
with:
29+
node-version-file: .nvmrc
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm --color ci
34+
35+
- name: Build
36+
run: npm --color run build
37+
38+
- name: Read version from package.json
39+
run: |
40+
VERSION=$(node -p "require('./package.json').version")
41+
echo "version=v$VERSION" >> $GITHUB_ENV
42+
43+
- name: Check whether this version is already published
44+
run: |
45+
if git ls-remote --exit-code --tags origin "refs/tags/${{ env.version }}" > /dev/null; then
46+
echo "Version ${{ env.version }} is already tagged."
47+
exit 1
48+
fi
49+
50+
- name: Publish to NPM
51+
run: npx -y npm@11.6.2 publish --access public
52+
53+
- name: Create Git tag
54+
run: |
55+
git tag ${{ env.version }}
56+
git push origin ${{ env.version }}

dist/snippetFormatter.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/snippetFormatter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/talonFormatter.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/talonFormatter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/treeSitterFormatter.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/treeSitterFormatter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cursorless/talon-tools",
3-
"version": "0.10.1",
3+
"version": "0.10.2",
44
"description": "Linting and formatting tools for Talon and Cursorless",
55
"author": "Cursorless Dev",
66
"license": "MIT",

0 commit comments

Comments
 (0)