Skip to content

Commit

Permalink
👷 ASL-4247: Publish to GitHub repo instead of private HomeOffice repo. (
Browse files Browse the repository at this point in the history
#86)

* ASL-4247: Boyscout: Remove contributors

* ASL-4247: Boyscout: Remove travis config

* ASL-4247: Boyscout: Import eslint from https://github.com/UKHomeOffice/hocs-frontend

* ASL-4247: Add Dependabot

* ASL-4247: Add Codeql

* ASL-4247: Add sas test workflow

* ASL-4247: Publish to GitHub repo.
This allows us to simplify CI pipelines and let developers access with credentials they already have.

* ASL-4247 - Corrected env var reference in .npmrc

---------

Co-authored-by: Tom Rowsell <[email protected]>
  • Loading branch information
nickmcmahon01 and tomrowsell86 authored Mar 23, 2023
1 parent 67266ab commit 40e0784
Show file tree
Hide file tree
Showing 41 changed files with 1,107 additions and 2,066 deletions.
51 changes: 0 additions & 51 deletions .all-contributorsrc

This file was deleted.

22 changes: 0 additions & 22 deletions .drone-1.0.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintrc

This file was deleted.

75 changes: 75 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
'env': {
'node': true,
'browser': true,
'commonjs': true,
'es6': true
},
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
'parserOptions': {
'ecmaVersion': 2020,
'sourceType': 'module'
},
'settings': {
'react': {
'version': 'detect'
}
},
'rules': {
'react/prop-types': 'off',
'indent': [
'error',
4
, { 'SwitchCase': 1 }
],
'linebreak-style': [
'error',
'unix'
],
'no-unused-vars': [
'error',
{ 'argsIgnorePattern': '^_$' }
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'object-curly-spacing': [
'error', 'always'
],
'no-trailing-spaces': [
'error'
]
},
'overrides': [
{
'files': [ '**/__tests__/**' ],
'env': {
'jest': true
},
'globals': {
'render': false,
'shallow': false,
'wrapper': false,
'mount': false
}
},
{
'files': [ '**/__snapshots__/**' ],
'excludedFiles': '*.js.snap'
},
{
'files': [ 'src/**' ],
'env': {
'commonjs': true
}
}
]
};
35 changes: 0 additions & 35 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "⬆️ "
pull-request-branch-name:
separator: "-"
reviewers:
- "UKHomeOffice/asl-devs"
labels:
- "skip-release"
- "dependencies"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "⬆️ "
pull-request-branch-name:
separator: "-"
reviewers:
- "UKHomeOffice/asl-devs"
labels:
- "patch"
- "dependencies"
39 changes: 39 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CodeQL Scan"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '45 12 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
9 changes: 9 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Publish - npm'
on:
pull_request:
types: [ closed ]

jobs:
publish:
uses: UKHomeOffice/sas-github-workflows/.github/workflows/publish-npm.yml@v1
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/semver-check-increment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Increment Version - npm'
on:
pull_request:
types: [ labeled, unlabeled, opened, reopened, synchronize ]

jobs:
version:
uses: UKHomeOffice/sas-github-workflows/.github/workflows/semver-check-increment-npm.yml@v1
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Test'
on:
pull_request:
types: [ opened, reopened, synchronize ]

jobs:
test:
uses: UKHomeOffice/sas-github-workflows/.github/workflows/test-npm.yml@v1
secrets: inherit
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ukhomeoffice:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

54 changes: 0 additions & 54 deletions CONTRIBUTING.md

This file was deleted.

14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# @ukhomeoffice/react-components
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)

A set of react components to build the basic elements descibed in [GOV.UK Design System](https://design-system.service.gov.uk/).
A set of react components to build the basic elements described in [GOV.UK Design System](https://design-system.service.gov.uk/).

## Details

Expand All @@ -11,6 +10,9 @@ the older [govuk_frontend_toolkit](https://github.com/alphagov/govuk_frontend_to
additional Home Office specific components.

## Using components

[Authenticate with GitHub packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token)

Install the package and any dependencies you have:
```bash
# Install @ukhomeoffice/react-components
Expand Down Expand Up @@ -49,3 +51,11 @@ $ cd example
$ npm start
$ open http://localhost:8080
```

## Publishing

This is automatically published to the GitHub packages npm repository using GitHub Actions.

When opening a pull request add a label `major`, `minor` or `patch` (or `skip-release`) and the version field in package.json will be updated by the pipeline using `npm version`.

It is published once the pull request is merged if there is no `skip-release` label on the pull request, the SHA is also tagged with the SemVer value at that point.
Loading

0 comments on commit 40e0784

Please sign in to comment.