From 704d83fe9ab11bac6f01ee1013bf7d0e3cdaed1c Mon Sep 17 00:00:00 2001 From: James Ives Date: Thu, 14 May 2020 17:42:55 -0400 Subject: [PATCH 01/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82c5ad33..f2f9204b 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ With the action correctly configured you should see the workflow trigger the dep The action will export an environment variable called `DEPLOYMENT_STATUS` that you can use in your workflow to determine if the deployment was successful or not. You can find an explanation of each status code below. | Status | Description | -| ------------- |:-------------:| +| ------------- |-------------| | `success` | The `success` status indicates that the action was able to successfully deploy the project to the branch. | | `failed` | The `failed` status indicates that the action encountered an error while trying to deploy the project. | | `skipped` | The `skipped` status indicates that the action exited early as there was nothing new to deploy. | From 13c38f2c39646539b868202129c447cc86610391 Mon Sep 17 00:00:00 2001 From: James Ives Date: Thu, 14 May 2020 21:52:08 +0000 Subject: [PATCH 02/11] =?UTF-8?q?Release=203.4.10=20=F0=9F=93=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7424b0a6..66fe69e8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "github-pages-deploy-action", "description": "GitHub action for building a project and deploying it to GitHub pages.", "author": "James Ives (https://jamesiv.es)", - "version": "3.4.9", + "version": "3.4.10", "license": "MIT", "main": "lib/lib.js", "types": "lib/lib.d.ts", From f57432925b4e9e5cfbee056dab1a28fe081f0cec Mon Sep 17 00:00:00 2001 From: James Ives Date: Thu, 14 May 2020 17:56:56 -0400 Subject: [PATCH 03/11] Removes the log --- __tests__/git.test.ts | 8 +++++--- src/lib.ts | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/__tests__/git.test.ts b/__tests__/git.test.ts index 262bc1af..127efcba 100644 --- a/__tests__/git.test.ts +++ b/__tests__/git.test.ts @@ -3,7 +3,7 @@ process.env['INPUT_FOLDER'] = 'build' process.env['GITHUB_SHA'] = '123' import {mkdirP, rmRF} from '@actions/io' -import {action} from '../src/constants' +import {action, Status} from '../src/constants' import {execute} from '../src/execute' import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git' @@ -338,11 +338,12 @@ describe('git', () => { } }) - await deploy(action) + const response = await deploy(action) // Includes the call to generateBranch expect(execute).toBeCalledTimes(11) expect(rmRF).toBeCalledTimes(1) + expect(response).toBe(Status.SUCCESS) }) it('should execute commands with single commit toggled', async () => { @@ -437,9 +438,10 @@ describe('git', () => { isTest: false // Setting this env variable to false means there will never be anything to commit and the action will exit early. }) - await deploy(action) + const response = await deploy(action) expect(execute).toBeCalledTimes(12) expect(rmRF).toBeCalledTimes(1) + expect(response).toBe(Status.SKIPPED) }) it('should throw an error if one of the required parameters is not available', async () => { diff --git a/src/lib.ts b/src/lib.ts index 2f303444..201cc79a 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -30,7 +30,6 @@ export default async function run( status = Status.FAILED setFailed(error.message) } finally { - console.log(status) info( `${ status === Status.FAILED From abad53bf8ad182cb686b0efa21a2abfa5a69212c Mon Sep 17 00:00:00 2001 From: James Ives Date: Thu, 14 May 2020 17:59:12 -0400 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2f9204b..b825d408 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ With the action correctly configured you should see the workflow trigger the dep #### Deployment Status -The action will export an environment variable called `DEPLOYMENT_STATUS` that you can use in your workflow to determine if the deployment was successful or not. You can find an explanation of each status code below. +The action will export an environment variable called `DEPLOYMENT_STATUS` that you can use in your workflow to determine if the deployment was successful or not. You can find an explanation of each status type below. | Status | Description | | ------------- |-------------| From 95ddf2e4428d8d647df66d01e5418f13fd47b728 Mon Sep 17 00:00:00 2001 From: James Ives Date: Thu, 14 May 2020 21:30:04 -0400 Subject: [PATCH 05/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66fe69e8..1771be0a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "github-pages-deploy-action", "description": "GitHub action for building a project and deploying it to GitHub pages.", "author": "James Ives (https://jamesiv.es)", - "version": "3.4.10", + "version": "3.5.0", "license": "MIT", "main": "lib/lib.js", "types": "lib/lib.d.ts", From b4ec2b47124bda60dcccf9b063689214ae9def95 Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 15 May 2020 01:31:35 +0000 Subject: [PATCH 06/11] =?UTF-8?q?Release=203.5.1=20=F0=9F=93=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1771be0a..512ae3d2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "github-pages-deploy-action", "description": "GitHub action for building a project and deploying it to GitHub pages.", "author": "James Ives (https://jamesiv.es)", - "version": "3.5.0", + "version": "3.5.1", "license": "MIT", "main": "lib/lib.js", "types": "lib/lib.d.ts", From cd57aa99e2e4ad7cd40440c77a522cd473343881 Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 15 May 2020 09:21:57 -0400 Subject: [PATCH 07/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b825d408..d30361ba 100644 --- a/README.md +++ b/README.md @@ -157,8 +157,8 @@ The action will export an environment variable called `DEPLOYMENT_STATUS` that y | Status | Description | | ------------- |-------------| -| `success` | The `success` status indicates that the action was able to successfully deploy the project to the branch. | -| `failed` | The `failed` status indicates that the action encountered an error while trying to deploy the project. | +| `success` | The `success` status indicates that the action was able to successfully deploy to the branch. | +| `failed` | The `failed` status indicates that the action encountered an error while trying to deploy. | | `skipped` | The `skipped` status indicates that the action exited early as there was nothing new to deploy. | --- From a3009d574332e690a1c14a84de1c0ad9e5ced725 Mon Sep 17 00:00:00 2001 From: James Ives Date: Sat, 16 May 2020 13:37:08 -0400 Subject: [PATCH 08/11] Update CONTRIBUTING.md --- CONTRIBUTING.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1f0a125..1a390480 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,18 +1,19 @@ -# Contributing +# Contributing ✏️ When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. +[email, or any other method with the owners of this repository](https://jamesiv.es) before making a change. -## Before Making a Pull Request +## Before Making a Pull Request 🎒 -1. Ensure that you've tested your feature/change yourself. As the primary focus of this project is deployment, providing a link to a deployed repository using your branch is preferred. You can reference the forked action using your GitHub username, for example `yourname/github-pages-deplpy-action@master`. -2. Make sure you update the README if you've made a change that requires documentation. -3. When making a pull request, highlight any areas that may cause a breaking change so the maintainer can update the version number accordingly on the GitHub marketplace. -4. Make sure you've formatted and linted your code. You can do this by running `yarn format` and `yarn lint`. -5. Fix or add any tests where applicable. You can run `yarn test` to run the suite. As this action is small in scope it's important that a high level of test coverage is maintained. All tests are written using Jest. -6. Ensure all typing is accurate and the action compiles correctly by running `yarn build`. +1. Ensure that you've tested your feature/change yourself. As the primary focus of this project is deployment, providing a link to a deployed repository using your branch is preferred. You can reference the forked action using your GitHub username, for example `yourname/github-pages-deplpy-action@master`. +2. Ensure your change passes all of the integration tests. +3. Make sure you update the README if you've made a change that requires documentation. +4. When making a pull request, highlight any areas that may cause a breaking change so the maintainer can update the version number accordingly on the GitHub marketplace and package registries. +5. Make sure you've formatted and linted your code. You can do this by running `yarn format` and `yarn lint`. +6. Fix or add any tests where applicable. You can run `yarn test` to run the suite. As this action is small in scope it's important that a high level of test coverage is maintained. All tests are written using [Jest](https://jestjs.io/). +7. As this package is written in [TypeScript](https://www.typescriptlang.org/) please ensure all typing is accurate and the action compiles correctly by running `yarn build`. -# Deploying +## Deploying 🚚 In order to deploy and test your own fork of this action, you must commit the `node_modules` dependencies. Be sure to run `nvm use` before installing any dependencies. You can learn more about nvm [here](https://github.com/nvm-sh/nvm/blob/master/README.md). @@ -43,4 +44,4 @@ $ git checkout -b branchnamehere $ git commit -a -m "prod dependencies" ``` -The `node_modules` folder should _not_ be included when making a pull request. These are only required for GitHub Actions when it consumes the distribution branch, the `dev` branch of the project should be free from any dependencies or lib files. \ No newline at end of file +The `node_modules` folder should _not_ be included when making a pull request. These are only required for GitHub Actions when it consumes the distribution branch, the `dev` branch of the project should be free from any dependencies or lib files. From 44b3ce1d390e9d64482766c38c6acd2a2053f474 Mon Sep 17 00:00:00 2001 From: James Ives Date: Sat, 16 May 2020 13:39:52 -0400 Subject: [PATCH 09/11] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a390480..c95bf0b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,3 +45,9 @@ $ git commit -a -m "prod dependencies" ``` The `node_modules` folder should _not_ be included when making a pull request. These are only required for GitHub Actions when it consumes the distribution branch, the `dev` branch of the project should be free from any dependencies or lib files. + +## Resources 💡 + +* [TypeScript](https://www.typescriptlang.org/) +* [Jest](https://jestjs.io/) +* [GitHub Actions Documentation](https://help.github.com/en/actions) From 8945e5d754ac23d27d03b5c9d373e046ffe9cada Mon Sep 17 00:00:00 2001 From: James Ives Date: Sat, 16 May 2020 18:11:24 -0400 Subject: [PATCH 10/11] Fixes Publishing Pipeline for GitHub --- .github/workflows/publish.yml | 23 ++++++++++++++++------- README.md | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9fc086e6..3a5946ba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,7 @@ name: publish-to-npm on: release: types: [created] + jobs: build: runs-on: ubuntu-latest @@ -11,21 +12,24 @@ jobs: ref: dev # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1.4.2 with: - node-version: 12 + node-version: '10.15.1' registry-url: 'https://registry.npmjs.org' + scope: '@jamesives' - name: Configure git run: | git config user.email "iam@jamesiv.es" git config user.name "James Ives" - - run: npm install - - run: npm run-script build + - name: Install Yarn + run: npm install -g yarn + + - run: yarn install --frozen-lockfile + - run: yarn build - run: npm version patch -m "Release %s 📣" - run: git push - - run: npm ci # Publish to npm - run: npm publish --access public @@ -33,11 +37,16 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1.4.2 with: node-version: 12 registry-url: 'https://npm.pkg.github.com' - scope: '@JamesIves' + scope: '@jamesives' + + - name: Authenticate with the GitHub Package Registry + run: + echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > + ~/.npmrc # Publish to GitHub Packages - run: npm publish diff --git a/README.md b/README.md index d30361ba..b62c7178 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- +

@@ -35,7 +35,7 @@

- +

## Getting Started :airplane: diff --git a/package.json b/package.json index 512ae3d2..26099656 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "github-pages-deploy-action", + "name": "@jamesives/github-pages-deploy-action", "description": "GitHub action for building a project and deploying it to GitHub pages.", "author": "James Ives (https://jamesiv.es)", "version": "3.5.1", From 9601af754e6fcddc964debf6a8f8eaaa45701b25 Mon Sep 17 00:00:00 2001 From: James Ives Date: Sat, 16 May 2020 18:12:18 -0400 Subject: [PATCH 11/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b62c7178..a613a8ca 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ on: If you'd like to use the functionality provided by this action in your own action you can install it using [yarn](https://yarnpkg.com/) by running the following command. ``` -yarn add github-pages-deploy-action +yarn add @jamesives/github-pages-deploy-action ``` It can then be imported into your project like so.