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

Publishing @eng-automation/testing to npm #7

Merged
merged 1 commit into from
Apr 12, 2023
Merged
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getConfiguration } = require("opstooling-js-style/src/eslint/configuration");
const { getConfiguration } = require("@eng-automation/js-style/src/eslint/configuration");

module.exports = getConfiguration({ typescript: { rootDir: __dirname } });
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
node-version: 16

- name: Install
run: yarn install --immutable --network-concurrency 1
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: NPM Release

on:
release:
types: [released]

jobs:
publish:
name: Build & Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Set version
run: npm version --no-git-tag-version ${{github.event.release.tag_name}}

- name: npm pack
run: npm pack

- uses: actions/upload-artifact@v3
with:
name: package
path: "eng-automation-testing-*.tgz"

- uses: octokit/request-action@v2.x
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("opstooling-js-style/src/prettier/configuration")
module.exports = require("@eng-automation/js-style/src/prettier/configuration")
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "opstooling-testing",
"version": "0.0.0",
"description": "Test helpers and fixtures for opstooling projects",
"repository": "git@github.com:paritytech/opstooling-testing.git",
"name": "@eng-automation/testing",
"version": "0.0.0-updated-via-gh-releases",
"description": "Parity EngAutomation test helpers and fixtures",
"author": "Parity <admin@parity.io> (https://parity.io)",
"license": "Apache-2.0",
"private": false,
Expand All @@ -19,16 +18,17 @@
"dist"
],
"dependencies": {
"selfsigned": "^2.1.0",
"@eng-automation/js": "^0.0.21",
"@octokit/rest": "^19.0.7",
"mockttp": "^3.6.2",
"node-fetch": "^2.6.7",
"opstooling-js": "https://github.com/paritytech/opstooling-js#v0.0.17"
"selfsigned": "^2.1.0"
},
"devDependencies": {
"@eng-automation/js-style": "^2.0.0",
"@octokit/webhooks-types": "^5.8.0",
"@types/node-fetch": "^2.6.2",
"@types/node": "^16",
"opstooling-js-style": "https://github.com/paritytech/opstooling-js-style#c298d0f732d93712e4397fd53baa3317a3022c8c",
"@types/node-fetch": "^2.6.2",
"ts-patch": "^2.0.2",
"typescript": "^4.6.2",
"typescript-transform-paths": "^3.4.4"
Expand Down
1 change: 1 addition & 0 deletions src/fixtures/github/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ export function getRepoPayload(params: { name: string; owner: string; node_id?:
default_branch: "master",
subscribers_count: 0,
network_count: 0,
has_discussions: false,
};
}
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/branches.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getGitLabBranchesPayload(params: { branchName: string }): JSONValue {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/job.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getPipelineJobsPayload(params: { status: string }): JSONValue {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getPipelinePayload(params: { status: string }): JSONValue {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getProjectPayload(params: { id: number; owner: string; name: string }): JSONValue {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/protectedBranches.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getProtectedBranchesPayload(): JSONValue {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/gitlab/protectedTags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "opstooling-js";
import { JSONValue } from "@eng-automation/js";

export function getProtectedTagsPayload(): JSONValue {
return [
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"allowSyntheticDefaultImports": true,
"useUnknownInCatchVariables": true,
"types": ["node"],
"typeRoots": ["./node_modules/@types", "./src", "opstooling-js"],
"typeRoots": ["./node_modules/@types", "./src", "@eng-automation/js"],
"paths": {
"src/*": ["./src/*"]
},
Expand Down
Loading