-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] publish releases on npm using github action
- Loading branch information
Showing
2 changed files
with
119 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
name: Integration testing | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
schedule: | ||
- cron: '0 20 * * *' | ||
|
||
jobs: | ||
test: | ||
name: test integration with bitrix portal | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} | ||
|
||
steps: | ||
- name: Get node version | ||
id: node | ||
run: echo "::set-output name=version::$(cat .github/.node-version)" | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Use node ${{ steps.node.version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.node.version }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Run integration tests | ||
name: Integration testing | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
schedule: | ||
- cron: '0 20 * * *' | ||
|
||
jobs: | ||
test: | ||
name: test integration with bitrix portal | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} | ||
|
||
steps: | ||
- name: Get node version | ||
id: node | ||
run: echo "::set-output name=version::$(cat .github/.node-version)" | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Use node ${{ steps.node.version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.node.version }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Run integration tests | ||
run: npm run test:integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Publishing on NPM | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
test: | ||
name: ensure that build is stable | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: true | ||
|
||
steps: | ||
- name: Get node version | ||
id: node | ||
run: echo "::set-output name=version::$(cat .github/.node-version)" | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Use node ${{ steps.node.version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.node.version }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: "~/.npm" | ||
key: "${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}" | ||
restore-keys: "${{ runner.os }}" | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Run unit tests | ||
run: npm run test:unit | ||
|
||
publish-npm: | ||
name: publish on npm | ||
needs: test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get node version | ||
id: node | ||
run: echo "::set-output name=version::$(cat .github/.node-version)" | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.node.version }} | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Publish release on NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
|
||
# publish-gpr: | ||
# name: publish on github | ||
# needs: test | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - uses: actions/checkout@v1 | ||
# with: | ||
# fetch-depth: 1 | ||
# - uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: 12 | ||
# registry-url: https://npm.pkg.github.com/ | ||
# scope: '@your-github-username' | ||
# - name: Install dependencies | ||
# run: npm ci | ||
# - run: npm publish | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |