Skip to content

Commit

Permalink
ci: use goreleaser custom publisher for npm releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed Nov 1, 2021
1 parent 0a3efd7 commit a1f98c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
- name: Get the version
if: startsWith(github.ref, 'refs/tags/')
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: NPM Release
if: startsWith(github.ref, 'refs/tags/')
run: |
./utils/set-npm-version.sh ${{ steps.get_version.outputs.VERSION }}
cat package.json
SCOOP_BUCKET_GITHUB_TOKEN: ${{ secrets.SCOOP_BUCKET_GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ scoop:
# If set to auto, the release will not be uploaded to the scoop bucket
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: true #TODO
#skip_upload: true #TODO

# Persist data between application updates
#persist:
Expand All @@ -201,3 +201,7 @@ scoop:
# An array of commands to be executed after an application is installed.
# Default is empty.
#post_install: ["Write-Host 'Running postinstall command'"]

publishers:
- name: npm-publisher
cmd: ./utils/set-npm-version.sh {{ .Version }}
1 change: 1 addition & 0 deletions utils/set-npm-version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
version=$1
cat package.json | jq ".version = \"$version\"" > package.json
cat package.json

0 comments on commit a1f98c1

Please sign in to comment.