Skip to content
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

run e2e:chrome in workflow #124

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/mobx-devtools-mst-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish mobx-devtools-mst

on:
push:
paths: [ "packages/mobx-devtools-mst/**", ".github/**" ]
branches: [ "master" ]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm run bootstrap
- name: Resolve new package version & Publish
working-directory: ./packages/mobx-devtools-mst
run: |
NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
export LATEST=$(npm show "$NAME@$VERSION" version --json)
NEXT=$(node -p "JSON.parse(process.env.LATEST).split('.').map((n, i) => i === 2 ? ++n : n).join('.')")
echo "NEXT: $NEXT"
npm version $NEXT --git-tag-version false
npm run build
cat ./package.json
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on: workflow_dispatch

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 17
registry-url: https://registry.npmjs.org/
- run: npm run bootstrap
- run: npm run build
- run: |
TAG=$(echo $TAG | cut -c1-8)
gh release create "$TAG" \
--repo="$GITHUB_REPOSITORY" \
--title="${TAG#v}" \
--generate-notes \
./lib/*.zip
env:
TAG: ${{ github.event.pull_request.head.sha || github.sha }}
GH_TOKEN: ${{ github.token }}
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 17
registry-url: https://registry.npmjs.org/
- run: npm run bootstrap
- run: npm run lint
- run: npm run build
- run: npm run test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:chrome": "cross-env NODE_ENV=production cross-env NODE_OPTIONS='--openssl-legacy-provider' TARGET_BROWSER=chrome node scripts/webextension/build.js && echo 'Chrome built'",
"start:firefox": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=firefox NODE_OPTIONS='--openssl-legacy-provider' node scripts/webextension/dev-server.js",
"build:firefox": "cross-env NODE_ENV=production TARGET_BROWSER=firefox NODE_OPTIONS='--openssl-legacy-provider' node scripts/webextension/build.js",
"test": "npm run test:unit ; npm run test:e2e",
"test": "npm run test:unit && npm run test:e2e:chrome",
"test:unit": "cross-env NODE_ENV=test NODE_OPTIONS='--openssl-legacy-provider' mocha --require 'babel-core/register' 'src/**/*-test.js'",
"test:e2e": "npm run test:e2e:chrome",
"test:e2e:chrome": "cross-env NODE_ENV=test TARGET_BROWSER=chrome NODE_OPTIONS='--openssl-legacy-provider' node scripts/webextension/build.js && npm run test:e2e:chrome:now",
Expand Down
Loading