Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch to github actions for v4 releases (#377)
- Loading branch information
Showing
7 changed files
with
137 additions
and
184 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: continuous integration | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node-version: ['10', '12', '14'] | ||
name: unit tests on node ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test | ||
- run: yarn coverage | ||
- uses: codecov/codecov-action@v2 | ||
|
||
lint: | ||
name: lint and format checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn lint | ||
- run: yarn format --check | ||
|
||
build: | ||
name: build assets and type definitions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn build:all |
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: publish | ||
on: | ||
push: | ||
branches: main | ||
tags: v* | ||
|
||
jobs: | ||
test: | ||
name: pre-publish test run | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test | ||
|
||
publish: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
name: publish packages to npm and site to S3 | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- name: build assets | ||
run: yarn build:all | ||
env: | ||
MIXPANEL_ID: ${{ secrets.MIXPANEL_TOKEN }} | ||
|
||
- name: get npm release tag | ||
id: npm_tag | ||
run: echo "::set-output name=tag::$(node scripts/get-npm-tag.js ${{ github.ref }})" | ||
|
||
- name: publish to npm with lerna | ||
run: npm run publish:npm -- --npm-tag ${{ steps.npm_tag.outputs.tag }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: publish to production S3 | ||
run: yarn publish:s3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_S3_REGION: us-east-2 | ||
AWS_S3_BUCKET: tracespace.io | ||
|
||
publish-staging: | ||
name: publish staging site to s3 | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- name: build assets | ||
run: yarn build:all | ||
env: | ||
MIXPANEL_ID: ${{ secrets.MIXPANEL_STAGING_TOKEN }} | ||
|
||
- name: publish to S3 | ||
run: yarn publish:s3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_S3_REGION: us-east-2 | ||
AWS_S3_BUCKET: staging.tracespace.io |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.