diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..55d5dfc1 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,28 @@ +name: Publish + +on: [push] + +jobs: + build: + name: Publish to GitHub Packages + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + - uses: actions/checkout@v2 + + - name: Read node version from .nvmrc + id: nvm + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + + - name: "Setup Node v${{ steps.nvm.outputs.NVMRC }}" + uses: actions/setup-node@v2 + with: + node-version: "${{ steps.nvm.outputs.NVMRC }}" + cache: 'npm' + + - name: Build + run: npm publish + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ba39fea9..a5832136 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: Test -on: [pull_request, push] +on: [push, pull_request] jobs: build: diff --git a/package.json b/package.json index 3b3c3d27..91345854 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "accessible-autocomplete-multi", + "name": "@OfficeForProductSafetyAndStandards/accessible-autocomplete-multi", "version": "2.0.4", "main": "dist/accessible-autocomplete.min.js", "style": "dist/accessible-autocomplete.min.css", "description": "An autocomplete component, built to be accessible.", - "repository": "github:OfficeForProductSafetyAndStandards/accessible-autocomplete-multi", + "repository": "https://github.com/OfficeForProductSafetyAndStandards/accessible-autocomplete-multi.git", "author": "Government Digital Service (https://www.gov.uk/government/organisations/government-digital-service) and Office for Product Safety & Standards (https://www.gov.uk/government/organisations/office-for-product-safety-and-standards)", "license": "MIT", "keywords": [ @@ -99,5 +99,7 @@ "standard": { "parser": "@babel/eslint-parser" }, - "private": true + "publishConfig": { + "registry": "https://npm.pkg.github.com" + } }