-
-
Notifications
You must be signed in to change notification settings - Fork 15
ci: release postject to npm on ci #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,6 +172,42 @@ commands: | |
- store_test_results: | ||
path: . | ||
|
||
publish: | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
|
||
- run: | ||
name: Remove unnecessary files | ||
command: rm -rf emsdk | ||
|
||
- run: | ||
name: Update version if not on git tag | ||
command: | | ||
if ! git describe --exact-match HEAD 1>/dev/null 2>/dev/null | ||
then | ||
git describe --exact-match HEAD 1>/dev/null 2>/dev/null && exit | ||
CURRENT_VERSION="$(node -p "require('./package.json').version")" | ||
GIT_COMMIT_SHA="$(git rev-parse --short HEAD)" | ||
npm version "$CURRENT_VERSION-$GIT_COMMIT_SHA" | ||
fi | ||
|
||
- run: | ||
name: Login to npm | ||
command: npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
|
||
- run: | ||
name: Publish to npm | ||
command: | | ||
if git describe --exact-match HEAD 1>/dev/null 2>/dev/null | ||
then | ||
# Publish to latest when a git tag is pushed. | ||
npm publish --tag latest | ||
else | ||
# Publish to beta when not run on a git tag. | ||
npm publish --tag beta | ||
fi | ||
|
||
## JOBS ## | ||
|
||
jobs: | ||
|
@@ -210,6 +246,14 @@ jobs: | |
os: << parameters.os >> | ||
- test | ||
|
||
publish: | ||
parameters: | ||
<<: *common_parameters | ||
executor: { name: linux } | ||
steps: | ||
- checkout | ||
- publish | ||
|
||
## WORKFLOWS ## | ||
|
||
matrix: &matrix | ||
|
@@ -229,4 +273,9 @@ workflows: | |
- test: | ||
<<: *matrix | ||
requires: [ build-<< matrix.os >> ] | ||
- publish: | ||
matrix: | ||
parameters: | ||
os: [ linux ] | ||
Comment on lines
+277
to
+279
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need a matrix here, or parameters for the |
||
requires: [ test-<< matrix.os >> ] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
build/ | ||
.circleci/ | ||
CMakeLists.txt | ||
CODEOWNERS | ||
DEPENDENCIES | ||
postject-api.h | ||
scripts/ | ||
src/ | ||
test/ | ||
vendor/ |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,12 @@ | |||||
Easily inject arbitrary read-only resources into executable formats | ||||||
(Mach-O, PE, ELF) and use it at runtime. | ||||||
|
||||||
## Install | ||||||
|
||||||
```sh | ||||||
npm i postject | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There's a good chance users of the Postject CLI will be using it outside of a Node project, so I think installing it globally is the better option. |
||||||
``` | ||||||
|
||||||
## Building | ||||||
|
||||||
### Prerequisites | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.