Skip to content

Commit 14b3b89

Browse files
committed
update cli publishing
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
1 parent 4ccc2d8 commit 14b3b89

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

.github/workflows/cli_cd.yaml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
contents: write
8686
steps:
8787
- uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 0
90+
fetch-tags: true
91+
- run: git fetch --tags --force
8892
- uses: actions/download-artifact@v4
8993
with:
9094
path: artifacts
@@ -99,16 +103,40 @@ jobs:
99103
TARBALLS=$(ls artifacts/*.tar.xz | tr '\n' ',')
100104
CHECKSUMS=$(ls artifacts/*.sha256 | tr '\n' ',')
101105
echo "list=${TARBALLS}${CHECKSUMS}" >> $GITHUB_OUTPUT
106+
- id: release-body
107+
env:
108+
VERSION: ${{ needs.compute-version.outputs.version }}
109+
run: |
110+
CURRENT_TAG="cli_v$VERSION"
111+
PREV_TAG=""
112+
LAST_TAG=""
113+
114+
while IFS= read -r tag; do
115+
if [[ "$tag" == "$CURRENT_TAG" ]]; then
116+
PREV_TAG="$LAST_TAG"
117+
break
118+
fi
119+
LAST_TAG="$tag"
120+
done < <(git tag -l 'cli_v*' --sort=v:refname)
121+
122+
if [[ -n "$PREV_TAG" ]]; then
123+
echo "value=https://github.com/${{ github.repository }}/compare/$PREV_TAG...$CURRENT_TAG" >> "$GITHUB_OUTPUT"
124+
else
125+
echo "value=https://github.com/${{ github.repository }}/commits/${{ github.sha }}" >> "$GITHUB_OUTPUT"
126+
fi
102127
- uses: ncipollo/release-action@v1
103128
with:
104129
tag: cli_v${{ needs.compute-version.outputs.version }}
105-
name: char v${{ needs.compute-version.outputs.version }}
130+
name: cli_v${{ needs.compute-version.outputs.version }}
131+
body: ${{ steps.release-body.outputs.value }}
106132
prerelease: ${{ inputs.channel == 'nightly' }}
107133
artifacts: ${{ steps.artifacts.outputs.list }}
108134

109135
publish-npm:
110136
needs: [compute-version, release]
111137
runs-on: ubuntu-latest
138+
permissions:
139+
id-token: write
112140
steps:
113141
- uses: actions/checkout@v4
114142
- uses: actions/setup-node@v4
@@ -125,6 +153,4 @@ jobs:
125153
pkg.version = '$VERSION';
126154
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
127155
"
128-
npm publish --access public --tag "$NPM_TAG"
129-
env:
130-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
156+
npm publish --tag "$NPM_TAG" --provenance

apps/cli/npm/install.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const REPO = "fastrepl/char";
88

99
const TARGETS = {
1010
"darwin-arm64": "aarch64-apple-darwin",
11-
"linux-x64": "x86_64-unknown-linux-gnu",
12-
"linux-arm64": "aarch64-unknown-linux-gnu",
11+
"darwin-x64": "x86_64-apple-darwin",
1312
};
1413

1514
const target = TARGETS[`${process.platform}-${process.arch}`];

apps/cli/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@fastrepl/char",
2+
"name": "char",
33
"version": "0.0.0",
44
"description": "Live transcription and audio tools",
55
"license": "GPL-3.0",

0 commit comments

Comments
 (0)