Skip to content

Commit

Permalink
Adds npm publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
finnhodgkin committed Oct 18, 2024
1 parent ad9648a commit ce24739
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
lfs: 'true'
submodules: recursive
lfs: "true"
- name: Install cargo-dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
Expand Down Expand Up @@ -266,6 +267,34 @@ jobs:
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
publish-npm:
needs:
- plan
- host
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- name: Fetch npm packages
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: npm/
merge-multiple: true
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: |
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith("-npm-package.tar.gz")] | any)'); do
pkg=$(echo "$release" | jq '.artifacts[] | select(endswith("-npm-package.tar.gz"))' --raw-output)
npm publish --access public "./npm/${pkg}"
done
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
announce:
needs:
- plan
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [ -n "${CARGO_DIST_TARGET:-}" ]; then
case "${CARGO_DIST_TARGET}" in
aarch64-apple-darwin)
# Do nothing - binary already built
chmod 755 purs
;;
x86_64-apple-darwin)
# TODO once we have the intel binary, rename the intel binary to purs here
Expand Down
4 changes: 2 additions & 2 deletions dist.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "purescript-lsp"
version = "1.0.4"
version = "1.0.5"
license = "BSD-3-Clause"
repository = "https://github.com/OxfordAbstracts/purescript-lsp-bin"
binaries = ["purs"]
Expand All @@ -21,4 +21,4 @@ windows-archive = ".tar.gz"
# The archive format to use for non-windows builds (defaults .tar.xz)
unix-archive = ".tar.gz"
# A namespace to use when publishing this package to the npm registry
npm-scope = "@oxfordabstracts"
npm-scope = "@oxfordabstracts"

0 comments on commit ce24739

Please sign in to comment.