-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 793 Bytes
/
Copy pathpublish.yml
File metadata and controls
34 lines (29 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Publish npm package
on:
push:
tags:
- "**"
permissions:
contents: read
jobs:
publish-npm:
runs-on: ubuntu-latest
environment: publish-npm
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- name: Build package tarball
run: nix build .#nix-eval-tarball
- name: Publish package
run: |
nix shell nixpkgs#nodejs --command sh -ceu '
version=$(node -p "require(\"./package.json\").version")
case "$version" in
*-*) tag=${version#*-}; tag=${tag%%.*} ;;
*) tag=latest ;;
esac
npm publish ./result/nix-eval-*.tgz --access public --tag "$tag"
'