Skip to content

Commit d81d37e

Browse files
authored
[build] Automatically run goreleaser for local builds (#91)
This previously required knowing to run `goreleaser` when building locally, as was being done in the Github Action. --------- Signed-off-by: Tyler Smalley <tyler@tailscale.com>
1 parent 0292844 commit d81d37e

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/package.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ jobs:
3434
- name: Capture version
3535
id: version
3636
run: npm run env | grep npm_package_version >> $GITHUB_OUTPUT
37-
- run: echo "version=${{ steps.version.outputs.npm_package_version }}"
38-
- name: Build Go
39-
run: |
40-
go install github.com/goreleaser/goreleaser@latest
41-
goreleaser build --snapshot --clean
37+
- name: Package
38+
run: tool/yarn package
4239
env:
4340
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.npm_package_version }}
44-
- name: Package
45-
run: tool/yarn vsce package --allow-star-activation
4641
- name: Upload vsix artifact
4742
uses: actions/upload-artifact@v3
4843
with:

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@
207207
"compile-tests": "tsc -p . --outDir out",
208208
"compile": "webpack",
209209
"lint": "eslint src --ext ts",
210-
"package": "webpack --mode production --devtool hidden-source-map",
210+
"bundle-js": "webpack --mode production --devtool hidden-source-map",
211+
"bundle-go": "go install github.com/goreleaser/goreleaser@6b46a1a && goreleaser build --snapshot --clean",
212+
"package": "vsce package --allow-star-activation",
211213
"precommit": "lint-staged",
212214
"prepare": "husky install",
213215
"pretest": "yarn run compile-tests && yarn run compile && yarn run lint",
214216
"test": "tool/node ./out/test/run-test.js",
215-
"vscode:prepublish": "yarn run package",
217+
"vscode:prepublish": "(yarn run bundle-js & pid1=$!; yarn run bundle-go & pid2=$!; wait $pid1 || exit 1; wait $pid2 || exit 1)",
216218
"watch-tests": "tsc -p . -w --outDir out",
217219
"watch": "webpack serve"
218220
},

0 commit comments

Comments
 (0)