fix: place tarball in a separate pack dir

This commit is contained in:
jedmao 2019-09-25 16:03:30 -05:00
parent df5b02ffff
commit 8d609a72ca
No known key found for this signature in database
GPG key ID: 7DA6E38CAB81A338
7 changed files with 10008 additions and 38 deletions

30
.github/workflows/master.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Node CI
on:
push:
branches:
- master
jobs:
release:
name: npm publish / GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install
env:
CI: true
run: npm ci
- name: Semantic Release
if: success()
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

1
.npmrc
View file

@ -1 +0,0 @@
package-lock=false

View file

@ -11,13 +11,13 @@
[ [
"@semantic-release/npm", "@semantic-release/npm",
{ {
"tarballDir": "dist" "tarballDir": "pack"
} }
], ],
[ [
"@semantic-release/github", "@semantic-release/github",
{ {
"assets": "dist/*.tgz" "assets": "pack/*.tgz"
} }
], ],
[ [

View file

@ -1,22 +0,0 @@
language: node_js
node_js:
- "lts/*"
cache: npm
branches:
only:
- master
after_success:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
deploy:
- provider: script
script: npx semantic-release -r
https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
skip_cleanup: true
keep_history: true
on:
branch: master

View file

@ -2,8 +2,14 @@
[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish npm packages with [GitHub](https://github.com). [**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish npm packages with [GitHub](https://github.com).
[![Travis](https://img.shields.io/travis/com/jedmao/semantic-release-npm-github-config.svg?style=popout-square&logo=travis)](https://travis-ci.com/jedmao/semantic-release-npm-github-config) <!-- prettier-ignore-start -->
[![npm version](https://img.shields.io/npm/v/@jedmao/semantic-release-npm-github-config/latest.svg?style=popout-square&logo=npm)](https://www.npmjs.com/package/@jedmao/semantic-release-npm-github-config) <!-- markdownlint-disable -->
[![GitHub Actions](https://github.com/jedmao/semantic-release-npm-github-config/workflows/master/badge.svg)](https://github.com/jedmao/semantic-release-npm-github-config/actions)
[![npm version](https://img.shields.io/npm/v/@jedmao/semantic-release-npm-github-config/latest.svg)](https://www.npmjs.com/package/@jedmao/semantic-release-npm-github-config)
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- markdownlint-disable commands-show-output -->
## Plugins ## Plugins
@ -45,5 +51,74 @@ The shareable config can be configured in the [**semantic-release** configuratio
Ensure that your CI configuration has the following **_secret_** environment variables set: Ensure that your CI configuration has the following **_secret_** environment variables set:
- [`GH_TOKEN`](https://github.com/settings/tokens) with [`public_repo`](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes) access. - [`GH_TOKEN`](https://github.com/settings/tokens) with [`public_repo`](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes) access.
- [`NPM_TOKEN`](https://docs.npmjs.com/cli/token) - [`NPM_TOKEN`](https://docs.npmjs.com/cli/token)
- [`NODE_AUTH_TOKEN`](https://docs.npmjs.com/cli/token)
See each [plugin](#plugins) documentation for required installation and configuration steps. See each [plugin](#plugins) documentation for required installation and configuration steps.
### GitHub workflows
If you're [configuring a GitHub workflow](https://help.github.com/en/articles/configuring-a-workflow) you might want to do a test build matrix first and then publish only if those tests succeed across all environments. The following will do just that, immediately after something is merged into `master`.
```yml
name: Node CI
on:
push:
branches:
- master
jobs:
test:
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [8, 10, 12]
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: Preserve line endings
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install & test/cover
run: npm ci && npm run cover
env:
CI: true
release:
name: npm publish / GitHub release
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install
env:
CI: true
run: npm ci
- name: Build
if: success()
run: npm run build
- name: Semantic Release
if: success()
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
```

9888
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/jedmao/semantic-release-npm-github-config.git" "url": "https://github.com/jedmao/semantic-release-npm-github-config.git"
}, },
"keywords": [ "keywords": [
"semantic-release", "semantic-release",
@ -45,20 +45,20 @@
"prettier": true "prettier": true
}, },
"dependencies": { "dependencies": {
"@semantic-release/changelog": "^3.0.2", "@semantic-release/changelog": "^3.0.4",
"@semantic-release/commit-analyzer": "^6.1.0", "@semantic-release/commit-analyzer": "^6.3.0",
"@semantic-release/git": "^7.0.8", "@semantic-release/git": "^7.0.16",
"@semantic-release/github": "^5.2.10", "@semantic-release/github": "^5.4.3",
"@semantic-release/npm": "^5.1.7", "@semantic-release/npm": "^5.1.15",
"@semantic-release/release-notes-generator": "^7.1.4" "@semantic-release/release-notes-generator": "^7.3.0"
}, },
"peerDependencies": { "peerDependencies": {
"semantic-release": ">=15.13.12 <16.0.0" "semantic-release": ">=15.13.24"
}, },
"devDependencies": { "devDependencies": {
"commitizen": "^3.1.1", "commitizen": "^4.0.3",
"cz-conventional-changelog": "^2.1.0", "cz-conventional-changelog": "^3.0.2",
"semantic-release": "^15.13.12", "semantic-release": "^15.13.24",
"xo": "^0.24.0" "xo": "^0.24.0"
} }
} }