Skip to content

Commit 6fee531

Browse files
authored
add release changes for hyp cli (#11)
1 parent 8939d8f commit 6fee531

File tree

9 files changed

+76
-455
lines changed

9 files changed

+76
-455
lines changed

.github/workflows/release-cli.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Release CLI"
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
permissions:
7+
contents: "write"
8+
id-token: write
9+
jobs:
10+
release:
11+
# note: must use GitHub-hosted runner for publishing to NPM with --provenance flag
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: "Validate version"
15+
if: ${{ !startsWith(github.ref_name, 'v') }}
16+
run: 'echo "Hyp CLI version must start with `v` && exit 1'
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: "${{ github.ref_name }}"
20+
- name: Parse CLI Version
21+
id: parse_cli_version
22+
run: |
23+
echo "cli_version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
24+
echo "npm_tag=$(echo '${{ github.ref_name }}' | sed -E 's/^[^-]+-([a-zA-Z]+).*/\1/ ; s/v.*/latest/')" >> $GITHUB_OUTPUT
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ">=22"
29+
registry-url: "https://registry.npmjs.org"
30+
- name: Prepare Release
31+
run: npm version ${{ steps.parse_cli_version.outputs.cli_version }} --no-git-tag-version
32+
- name: Install Dependencies
33+
run: npm ci
34+
- name: Build
35+
run: npm run build
36+
- name: Publish NPM Package
37+
run: npm publish --provenance --access public --tag ${{ steps.parse_cli_version.outputs.npm_tag }}
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
- name: Create Release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
prerelease: ${{ contains(steps.parse_cli_version.outputs.cli_version, '-') }}
44+
make_latest: ${{ contains(steps.parse_cli_version.outputs.cli_version, '-') }}

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ A new CLI for the Hypermode service
1616

1717
<!-- usage -->
1818
```sh-session
19-
$ npm install -g @hyp/cli
19+
$ npm install -g @hypermode/hyp-cli
2020
$ hyp COMMAND
2121
running command...
2222
$ hyp (--version)
23-
@hyp/cli/0.0.0 linux-x64 node-v22.8.0
23+
@hypermode/hyp-cli/0.0.1-alpha.1 darwin-arm64 node-v22.9.0
2424
$ hyp --help [COMMAND]
2525
USAGE
2626
$ hyp COMMAND
@@ -40,28 +40,28 @@ USAGE
4040
Login to Hypermode Console
4141

4242
```
43-
Usage: hyp login
43+
[1mUsage:[22m [1m[94mhyp[39m[22m login
4444
```
4545

46-
_See code: [src/commands/login/index.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.0/src/commands/login/index.ts)_
46+
_See code: [src/commands/login/index.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.1-alpha.1/src/commands/login/index.ts)_
4747

4848
## `hyp logout`
4949

5050
Logout of Hypermode Console in the CLI
5151

5252
```
53-
Usage: hyp logout
53+
[1mUsage:[22m [1m[94mhyp[39m[22m logout
5454
```
5555

56-
_See code: [src/commands/logout/index.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.0/src/commands/logout/index.ts)_
56+
_See code: [src/commands/logout/index.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.1-alpha.1/src/commands/logout/index.ts)_
5757

5858
## `hyp org switch`
5959

6060
Switch the current Hypermode organization
6161

6262
```
63-
Usage: hyp org:switch
63+
[1mUsage:[22m [1m[94mhyp[39m[22m org:switch
6464
```
6565

66-
_See code: [src/commands/org/switch.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.0/src/commands/org/switch.ts)_
66+
_See code: [src/commands/org/switch.ts](https://github.com/hypermodeinc/hyp-cli/blob/v0.0.1-alpha.1/src/commands/org/switch.ts)_
6767
<!-- commandsstop -->

0 commit comments

Comments
 (0)