Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit be1b301

Browse files
author
Hendrik van Antwerpen
authored
Merge pull request #137 from github/auto-releases
Add GitHub release jobs for each create
2 parents 415b1ba + e88c5e1 commit be1b301

File tree

5 files changed

+96
-75
lines changed

5 files changed

+96
-75
lines changed

.github/workflows/publish-stack-graphs-crate.yml renamed to .github/workflows/publish-lsp-positions.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: Publish stack-graphs on crates.io
1+
name: Publish lsp-positions release
22

33
on:
44
push:
55
tags:
6-
- stack-graphs-v*'
7-
8-
env:
9-
CARGO_TERM_COLOR: always
10-
CARGO_INCREMENTAL: 0
11-
CRATE_DIR: './stack-graphs'
6+
- lsp-positions-v*
127

138
jobs:
14-
publish:
9+
publish-crate:
1510
runs-on: ubuntu-latest
11+
env:
12+
CARGO_TERM_COLOR: always
13+
CARGO_INCREMENTAL: 0
14+
CRATE_DIR: './lsp-positions'
1615
steps:
1716
- name: Install Rust environment
1817
uses: hecrj/setup-rust-action@v1
@@ -29,3 +28,14 @@ jobs:
2928
with:
3029
path: ${{ env.CRATE_DIR }}
3130
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
create-release:
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
- name: Create GitHub release
39+
uses: ncipollo/release-action@v1
40+
with:
41+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-lsp-positions-crate.yml renamed to .github/workflows/publish-stack-graphs.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: Publish lsp-positions on crates.io
1+
name: Publish stack-graphs release
22

33
on:
44
push:
55
tags:
6-
- lsp-positions-v*'
7-
8-
env:
9-
CARGO_TERM_COLOR: always
10-
CARGO_INCREMENTAL: 0
11-
CRATE_DIR: './lsp-positions'
6+
- stack-graphs-v*
127

138
jobs:
14-
publish:
9+
publish-crate:
1510
runs-on: ubuntu-latest
11+
env:
12+
CARGO_TERM_COLOR: always
13+
CARGO_INCREMENTAL: 0
14+
CRATE_DIR: './stack-graphs'
1615
steps:
1716
- name: Install Rust environment
1817
uses: hecrj/setup-rust-action@v1
@@ -29,3 +28,14 @@ jobs:
2928
with:
3029
path: ${{ env.CRATE_DIR }}
3130
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
create-release:
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
- name: Create GitHub release
39+
uses: ncipollo/release-action@v1
40+
with:
41+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-tree-sitter-stack-graphs-crate.yml

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

.github/workflows/publish-tree-sitter-stack-graphs-npm.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish tree-sitter-stack-graphs release
2+
3+
on:
4+
push:
5+
tags:
6+
- tree-sitter-stack-graphs-v*
7+
8+
jobs:
9+
publish-crate:
10+
runs-on: ubuntu-latest
11+
env:
12+
CARGO_TERM_COLOR: always
13+
CARGO_INCREMENTAL: 0
14+
CRATE_DIR: './tree-sitter-stack-graphs'
15+
steps:
16+
- name: Install Rust environment
17+
uses: hecrj/setup-rust-action@v1
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
# TODO Verify the crate version matches the tag
21+
- name: Verify publish crate
22+
uses: katyo/publish-crates@v1
23+
with:
24+
path: ${{ env.CRATE_DIR }}
25+
dry-run: true
26+
- name: Publish crate
27+
uses: katyo/publish-crates@v1
28+
with:
29+
path: ${{ env.CRATE_DIR }}
30+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
publish-npm:
32+
runs-on: ubuntu-latest
33+
env:
34+
PACKAGE_DIR: './tree-sitter-stack-graphs/npm'
35+
steps:
36+
- name: Install Node environment
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: 16.x
40+
registry-url: 'https://registry.npmjs.org'
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
# TODO Verify the package version matches the tag
44+
- name: Verify package
45+
run: npm publish --dry-run ${{ env.PACKAGE_DIR }}
46+
- name: Publish package
47+
run: npm publish ${{ env.PACKAGE_DIR }}
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
create-release:
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: write
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v2
57+
- name: Create GitHub release
58+
uses: ncipollo/release-action@v1
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)