From a3e6ce2153fa695e13226f8273de18260700ff4e Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 15 Nov 2019 16:01:13 -0800 Subject: [PATCH 01/55] Adding maven auth support --- __tests__/auth.test.ts | 36 ++++++++++++++++++++++++++++++++ lib/auth.js | 47 ++++++++++++++++++++++++++++++++++++++++++ lib/setup-java.js | 45 ++++++++++++++++++++++++++++++++++++++++ src/auth.ts | 31 ++++++++++++++++++++++++++++ src/setup-java.ts | 8 +++++++ 5 files changed, 167 insertions(+) create mode 100644 __tests__/auth.test.ts create mode 100644 lib/auth.js create mode 100644 lib/setup-java.js create mode 100644 src/auth.ts diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts new file mode 100644 index 00000000..937d119d --- /dev/null +++ b/__tests__/auth.test.ts @@ -0,0 +1,36 @@ +import io = require('@actions/io'); +import fs = require('fs'); +import path = require('path'); +import child_process = require('child_process'); + +const m2Dir = path.join(__dirname, '.m2'); +const settingsFile = path.join(m2Dir, 'settings.xml'); + +import * as auth from '../src/auth'; + +describe('auth tests', () => { + beforeAll(async () => { + await io.rmRF(m2Dir); + }, 300000); + + afterAll(async () => { + try { + await io.rmRF(m2Dir); + } catch { + console.log('Failed to remove test directories'); + } + }, 100000); + + it('Creates settings.xml file with username and password', async () => { + const username = 'bluebottle'; + const password = 'SingleOrigin'; + + await auth.configAuthentication(username, password); + + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate(username, password) + ); + }, 100000); +}); diff --git a/lib/auth.js b/lib/auth.js new file mode 100644 index 00000000..33e643be --- /dev/null +++ b/lib/auth.js @@ -0,0 +1,47 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(require("fs")); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +const io = __importStar(require("@actions/io")); +function configAuthentication(username, password) { + return __awaiter(this, void 0, void 0, function* () { + const directory = path.join(os.homedir(), '.m2'); + yield io.mkdirP(directory); + yield write(directory, generate(username, password)); + }); +} +exports.configAuthentication = configAuthentication; +// only exported for testing purposes +function generate(username = '${actions.username}', password = '${actions.password}') { + return ` + + + ${username} + ${password} + + + + `; +} +exports.generate = generate; +function write(directory, settings) { + return __awaiter(this, void 0, void 0, function* () { + return fs.writeFileSync(path.join(directory, 'settings.xml'), settings); + }); +} diff --git a/lib/setup-java.js b/lib/setup-java.js new file mode 100644 index 00000000..1028cf84 --- /dev/null +++ b/lib/setup-java.js @@ -0,0 +1,45 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const core = __importStar(require("@actions/core")); +const installer = __importStar(require("./installer")); +const auth = __importStar(require("./auth")); +const path = __importStar(require("path")); +function run() { + return __awaiter(this, void 0, void 0, function* () { + try { + let version = core.getInput('version'); + if (!version) { + version = core.getInput('java-version', { required: true }); + } + const arch = core.getInput('architecture', { required: true }); + const jdkFile = core.getInput('jdkFile', { required: false }) || ''; + yield installer.getJava(version, arch, jdkFile); + const username = core.getInput('username', { required: false }); + const password = core.getInput('password', { required: false }); + if (username && password) { + yield auth.configAuthentication(username, password); + } + const matchersPath = path.join(__dirname, '..', '.github'); + console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); + } + catch (error) { + core.setFailed(error.message); + } + }); +} +run(); diff --git a/src/auth.ts b/src/auth.ts new file mode 100644 index 00000000..328c54f7 --- /dev/null +++ b/src/auth.ts @@ -0,0 +1,31 @@ +import * as fs from 'fs'; +import * as os from 'os'; +import * as path from 'path'; +import * as core from '@actions/core'; +import * as io from '@actions/io'; + +export async function configAuthentication(username: string, password: string) { + const directory: string = path.join(os.homedir(), '.m2'); + await io.mkdirP(directory); + await write(directory, generate(username, password)); +} + +// only exported for testing purposes +export function generate( + username = '${actions.username}', + password = '${actions.password}' +) { + return ` + + + ${username} + ${password} + + + + `; +} + +async function write(directory: string, settings: string) { + return fs.writeFileSync(path.join(directory, 'settings.xml'), settings); +} diff --git a/src/setup-java.ts b/src/setup-java.ts index 1d26bffe..e6b179ed 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core'; import * as installer from './installer'; +import * as auth from './auth'; import * as path from 'path'; async function run() { @@ -14,6 +15,13 @@ async function run() { await installer.getJava(version, arch, jdkFile, javaPackage); + const username = core.getInput('username', {required: false}); + const password = core.getInput('password', {required: false}); + + if (username && password) { + await auth.configAuthentication(username, password); + } + const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); } catch (error) { From 56b5af70cfb7ccc2f15b5c6106ac6b0fb91c1432 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 20 Nov 2019 10:23:50 -0800 Subject: [PATCH 02/55] ignore vscode directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 370c1f6e..e6dc0cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,4 @@ typings/ # DynamoDB Local files .dynamodb/ +.vscode/ From 56eacf97f5ab81cf3d99d685fb9faf78c9028a0f Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 20 Nov 2019 10:25:21 -0800 Subject: [PATCH 03/55] move required parameters to auth module username and password are required from within the auth module now. Update the tests to ensure this is the case. --- __tests__/auth.test.ts | 34 ++++++++++++++++++++++++++----- src/auth.ts | 46 ++++++++++++++++++++++++++---------------- src/setup-java.ts | 4 +--- 3 files changed, 59 insertions(+), 25 deletions(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 937d119d..4a3119d3 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -1,15 +1,22 @@ import io = require('@actions/io'); import fs = require('fs'); +import os = require('os'); import path = require('path'); -import child_process = require('child_process'); -const m2Dir = path.join(__dirname, '.m2'); -const settingsFile = path.join(m2Dir, 'settings.xml'); +// make the os.homedir() call be local to the tests +jest.doMock('os', () => { + return { + homedir: jest.fn(() => __dirname) + }; +}); import * as auth from '../src/auth'; +const m2Dir = path.join(__dirname, auth.M2_DIR); +const settingsFile = path.join(m2Dir, auth.SETTINGS_FILE); + describe('auth tests', () => { - beforeAll(async () => { + beforeEach(async () => { await io.rmRF(m2Dir); }, 300000); @@ -21,7 +28,7 @@ describe('auth tests', () => { } }, 100000); - it('Creates settings.xml file with username and password', async () => { + it('creates settings.xml with username and password', async () => { const username = 'bluebottle'; const password = 'SingleOrigin'; @@ -33,4 +40,21 @@ describe('auth tests', () => { auth.generate(username, password) ); }, 100000); + + it('does not create settings.xml without username and / or password', async () => { + await auth.configAuthentication('FOO', ''); + + expect(fs.existsSync(m2Dir)).toBe(false); + expect(fs.existsSync(settingsFile)).toBe(false); + + await auth.configAuthentication('', 'BAR'); + + expect(fs.existsSync(m2Dir)).toBe(false); + expect(fs.existsSync(settingsFile)).toBe(false); + + await auth.configAuthentication('', ''); // BAZ!!! + + expect(fs.existsSync(m2Dir)).toBe(false); + expect(fs.existsSync(settingsFile)).toBe(false); + }, 100000); }); diff --git a/src/auth.ts b/src/auth.ts index 328c54f7..252423a8 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -4,28 +4,40 @@ import * as path from 'path'; import * as core from '@actions/core'; import * as io from '@actions/io'; +export const M2_DIR = '.m2'; +export const SETTINGS_FILE = 'settings.xml'; + export async function configAuthentication(username: string, password: string) { - const directory: string = path.join(os.homedir(), '.m2'); - await io.mkdirP(directory); - await write(directory, generate(username, password)); + if (username && password) { + core.debug(`configAuthentication with ${username} and a password`); + const directory: string = path.join(os.homedir(), M2_DIR); + await io.mkdirP(directory); + core.debug(`created directory ${directory}`); + await write(directory, generate(username, password)); + } else { + core.debug( + `no auth without username: ${username} and password: ${password}` + ); + } } // only exported for testing purposes -export function generate( - username = '${actions.username}', - password = '${actions.password}' -) { - return ` - - - ${username} - ${password} - - - - `; +export function generate(username: string, password: string) { + return ` + + + + ${username} + ${password} + + + + `; } async function write(directory: string, settings: string) { - return fs.writeFileSync(path.join(directory, 'settings.xml'), settings); + const options = {encoding: 'utf-8'}; + const location = path.join(directory, SETTINGS_FILE); + core.debug(`writing ${location}`); + return fs.writeFileSync(location, settings, options); } diff --git a/src/setup-java.ts b/src/setup-java.ts index e6b179ed..9e52f9b1 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -18,9 +18,7 @@ async function run() { const username = core.getInput('username', {required: false}); const password = core.getInput('password', {required: false}); - if (username && password) { - await auth.configAuthentication(username, password); - } + await auth.configAuthentication(username, password); const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); From 86e89385e588f397a8029c26279d630dee37462a Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 20 Nov 2019 10:25:37 -0800 Subject: [PATCH 04/55] Add generated auth and setup-java --- lib/auth.js | 42 ++++++++++++++++++++++++++++-------------- lib/setup-java.js | 4 +--- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index 33e643be..4bfc3c7c 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -18,30 +18,44 @@ Object.defineProperty(exports, "__esModule", { value: true }); const fs = __importStar(require("fs")); const os = __importStar(require("os")); const path = __importStar(require("path")); +const core = __importStar(require("@actions/core")); const io = __importStar(require("@actions/io")); +exports.M2_DIR = '.m2'; +exports.SETTINGS_FILE = 'settings.xml'; function configAuthentication(username, password) { return __awaiter(this, void 0, void 0, function* () { - const directory = path.join(os.homedir(), '.m2'); - yield io.mkdirP(directory); - yield write(directory, generate(username, password)); + if (username && password) { + core.debug(`configAuthentication with ${username} and a password`); + const directory = path.join(os.homedir(), exports.M2_DIR); + yield io.mkdirP(directory); + core.debug(`created directory ${directory}`); + yield write(directory, generate(username, password)); + } + else { + core.debug(`no auth without username: ${username} and password: ${password}`); + } }); } exports.configAuthentication = configAuthentication; // only exported for testing purposes -function generate(username = '${actions.username}', password = '${actions.password}') { - return ` - - - ${username} - ${password} - - - - `; +function generate(username, password) { + return ` + + + + ${username} + ${password} + + + + `; } exports.generate = generate; function write(directory, settings) { return __awaiter(this, void 0, void 0, function* () { - return fs.writeFileSync(path.join(directory, 'settings.xml'), settings); + const options = { encoding: 'utf-8' }; + const location = path.join(directory, exports.SETTINGS_FILE); + core.debug(`writing ${location}`); + return fs.writeFileSync(location, settings, options); }); } diff --git a/lib/setup-java.js b/lib/setup-java.js index 1028cf84..a000d4e6 100644 --- a/lib/setup-java.js +++ b/lib/setup-java.js @@ -31,9 +31,7 @@ function run() { yield installer.getJava(version, arch, jdkFile); const username = core.getInput('username', { required: false }); const password = core.getInput('password', { required: false }); - if (username && password) { - yield auth.configAuthentication(username, password); - } + yield auth.configAuthentication(username, password); const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); } From 1b0417032a879685f08952bdd927ad3015219aee Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 09:52:58 -0800 Subject: [PATCH 05/55] Move auth to the bottom of setup --- src/setup-java.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/setup-java.ts b/src/setup-java.ts index 9e52f9b1..99026e34 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -15,13 +15,16 @@ async function run() { await installer.getJava(version, arch, jdkFile, javaPackage); + const matchersPath = path.join(__dirname, '..', '.github'); + console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); + const username = core.getInput('username', {required: false}); const password = core.getInput('password', {required: false}); - await auth.configAuthentication(username, password); + if (username && password) { + await auth.configAuthentication(username, password); + } - const matchersPath = path.join(__dirname, '..', '.github'); - console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); } catch (error) { core.setFailed(error.message); } From b0e5cf270d5e17b8428c466710bc07c39725573a Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:40:08 -0800 Subject: [PATCH 06/55] Support ids --- __tests__/auth.test.ts | 16 +++++++++++----- src/auth.ts | 9 +++++---- src/setup-java.ts | 5 +++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 4a3119d3..8e5efd4e 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -29,30 +29,36 @@ describe('auth tests', () => { }, 100000); it('creates settings.xml with username and password', async () => { + const id = 'packages'; const username = 'bluebottle'; const password = 'SingleOrigin'; - await auth.configAuthentication(username, password); + await auth.configAuthentication(id, username, password); expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( - auth.generate(username, password) + auth.generate(id, username, password) ); }, 100000); it('does not create settings.xml without username and / or password', async () => { - await auth.configAuthentication('FOO', ''); + await auth.configAuthentication('FOO', '', ''); expect(fs.existsSync(m2Dir)).toBe(false); expect(fs.existsSync(settingsFile)).toBe(false); - await auth.configAuthentication('', 'BAR'); + await auth.configAuthentication('', 'BAR', ''); expect(fs.existsSync(m2Dir)).toBe(false); expect(fs.existsSync(settingsFile)).toBe(false); - await auth.configAuthentication('', ''); // BAZ!!! + await auth.configAuthentication('', '', 'BAZ'); + + expect(fs.existsSync(m2Dir)).toBe(false); + expect(fs.existsSync(settingsFile)).toBe(false); + + await auth.configAuthentication('', '', ''); expect(fs.existsSync(m2Dir)).toBe(false); expect(fs.existsSync(settingsFile)).toBe(false); diff --git a/src/auth.ts b/src/auth.ts index 252423a8..d3c13bc1 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -7,13 +7,13 @@ import * as io from '@actions/io'; export const M2_DIR = '.m2'; export const SETTINGS_FILE = 'settings.xml'; -export async function configAuthentication(username: string, password: string) { - if (username && password) { +export async function configAuthentication(id: string, username: string, password: string) { + if (id && username && password) { core.debug(`configAuthentication with ${username} and a password`); const directory: string = path.join(os.homedir(), M2_DIR); await io.mkdirP(directory); core.debug(`created directory ${directory}`); - await write(directory, generate(username, password)); + await write(directory, generate(id, username, password)); } else { core.debug( `no auth without username: ${username} and password: ${password}` @@ -22,11 +22,12 @@ export async function configAuthentication(username: string, password: string) { } // only exported for testing purposes -export function generate(username: string, password: string) { +export function generate(id: string, username: string, password: string) { return ` + ${id} ${username} ${password} diff --git a/src/setup-java.ts b/src/setup-java.ts index 99026e34..2a731164 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -18,11 +18,12 @@ async function run() { const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); + const id = core.getInput('id', {required: false}); const username = core.getInput('username', {required: false}); const password = core.getInput('password', {required: false}); - if (username && password) { - await auth.configAuthentication(username, password); + if (id && username && password) { + await auth.configAuthentication(id, username, password); } } catch (error) { From dc5f78f54d4e2452492208bb2dd5164231dc2623 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:40:45 -0800 Subject: [PATCH 07/55] generated and pretty files --- lib/auth.js | 9 +++++---- lib/setup-java.js | 9 ++++++--- src/auth.ts | 6 +++++- src/setup-java.ts | 1 - 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index 4bfc3c7c..9b03d1cd 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -22,14 +22,14 @@ const core = __importStar(require("@actions/core")); const io = __importStar(require("@actions/io")); exports.M2_DIR = '.m2'; exports.SETTINGS_FILE = 'settings.xml'; -function configAuthentication(username, password) { +function configAuthentication(id, username, password) { return __awaiter(this, void 0, void 0, function* () { - if (username && password) { + if (id && username && password) { core.debug(`configAuthentication with ${username} and a password`); const directory = path.join(os.homedir(), exports.M2_DIR); yield io.mkdirP(directory); core.debug(`created directory ${directory}`); - yield write(directory, generate(username, password)); + yield write(directory, generate(id, username, password)); } else { core.debug(`no auth without username: ${username} and password: ${password}`); @@ -38,11 +38,12 @@ function configAuthentication(username, password) { } exports.configAuthentication = configAuthentication; // only exported for testing purposes -function generate(username, password) { +function generate(id, username, password) { return ` + ${id} ${username} ${password} diff --git a/lib/setup-java.js b/lib/setup-java.js index a000d4e6..ce1e3760 100644 --- a/lib/setup-java.js +++ b/lib/setup-java.js @@ -29,11 +29,14 @@ function run() { const arch = core.getInput('architecture', { required: true }); const jdkFile = core.getInput('jdkFile', { required: false }) || ''; yield installer.getJava(version, arch, jdkFile); - const username = core.getInput('username', { required: false }); - const password = core.getInput('password', { required: false }); - yield auth.configAuthentication(username, password); const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); + const id = core.getInput('id', { required: false }); + const username = core.getInput('username', { required: false }); + const password = core.getInput('password', { required: false }); + if (id && username && password) { + yield auth.configAuthentication(id, username, password); + } } catch (error) { core.setFailed(error.message); diff --git a/src/auth.ts b/src/auth.ts index d3c13bc1..4979045c 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -7,7 +7,11 @@ import * as io from '@actions/io'; export const M2_DIR = '.m2'; export const SETTINGS_FILE = 'settings.xml'; -export async function configAuthentication(id: string, username: string, password: string) { +export async function configAuthentication( + id: string, + username: string, + password: string +) { if (id && username && password) { core.debug(`configAuthentication with ${username} and a password`); const directory: string = path.join(os.homedir(), M2_DIR); diff --git a/src/setup-java.ts b/src/setup-java.ts index 2a731164..39f5466b 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -25,7 +25,6 @@ async function run() { if (id && username && password) { await auth.configAuthentication(id, username, password); } - } catch (error) { core.setFailed(error.message); } From 24327359f8649bb465e20dee2b6d8c8cce2c1272 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:53:22 -0800 Subject: [PATCH 08/55] use server-id instead of ambigous id --- src/setup-java.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup-java.ts b/src/setup-java.ts index 39f5466b..419b9ea4 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -18,7 +18,7 @@ async function run() { const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - const id = core.getInput('id', {required: false}); + const id = core.getInput('server-id', {required: false}); const username = core.getInput('username', {required: false}); const password = core.getInput('password', {required: false}); From b8a0027e2cdcd55e80a1bd0c14f91d9e18a4273e Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:54:29 -0800 Subject: [PATCH 09/55] Use console.log where appropriate --- lib/auth.js | 6 +++--- lib/setup-java.js | 2 +- src/auth.ts | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index 9b03d1cd..f8d795a7 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -25,14 +25,14 @@ exports.SETTINGS_FILE = 'settings.xml'; function configAuthentication(id, username, password) { return __awaiter(this, void 0, void 0, function* () { if (id && username && password) { - core.debug(`configAuthentication with ${username} and a password`); + console.log(`creating ${exports.SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password`); const directory = path.join(os.homedir(), exports.M2_DIR); yield io.mkdirP(directory); core.debug(`created directory ${directory}`); yield write(directory, generate(id, username, password)); } else { - core.debug(`no auth without username: ${username} and password: ${password}`); + core.debug(`no ${exports.SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password`); } }); } @@ -56,7 +56,7 @@ function write(directory, settings) { return __awaiter(this, void 0, void 0, function* () { const options = { encoding: 'utf-8' }; const location = path.join(directory, exports.SETTINGS_FILE); - core.debug(`writing ${location}`); + console.log(`writing ${location}`); return fs.writeFileSync(location, settings, options); }); } diff --git a/lib/setup-java.js b/lib/setup-java.js index ce1e3760..5372cbb6 100644 --- a/lib/setup-java.js +++ b/lib/setup-java.js @@ -31,7 +31,7 @@ function run() { yield installer.getJava(version, arch, jdkFile); const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - const id = core.getInput('id', { required: false }); + const id = core.getInput('server-id', { required: false }); const username = core.getInput('username', { required: false }); const password = core.getInput('password', { required: false }); if (id && username && password) { diff --git a/src/auth.ts b/src/auth.ts index 4979045c..b61b357d 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -13,14 +13,16 @@ export async function configAuthentication( password: string ) { if (id && username && password) { - core.debug(`configAuthentication with ${username} and a password`); + console.log( + `creating ${SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password` + ); const directory: string = path.join(os.homedir(), M2_DIR); await io.mkdirP(directory); core.debug(`created directory ${directory}`); await write(directory, generate(id, username, password)); } else { core.debug( - `no auth without username: ${username} and password: ${password}` + `no ${SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password` ); } } @@ -43,6 +45,6 @@ export function generate(id: string, username: string, password: string) { async function write(directory: string, settings: string) { const options = {encoding: 'utf-8'}; const location = path.join(directory, SETTINGS_FILE); - core.debug(`writing ${location}`); + console.log(`writing ${location}`); return fs.writeFileSync(location, settings, options); } From 4450e92d7814b023e1185a4c81037df93697bcd4 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 13:00:30 -0800 Subject: [PATCH 10/55] Use gitattributes to ignore generated lib js files --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..33c66243 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +lib/*.js -diff -merge +lib/*.js linguist-generated=true From 18983b8d3d6bbec73377e2c02d64915f1d0be621 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 13:10:44 -0800 Subject: [PATCH 11/55] Update gitattributes and remove lib files --- .gitattributes | 4 +-- dist/index.js | Bin 161897 -> 164736 bytes lib/auth.js | 62 ---------------------------------------------- lib/setup-java.js | 46 ---------------------------------- 4 files changed, 2 insertions(+), 110 deletions(-) delete mode 100644 lib/auth.js delete mode 100644 lib/setup-java.js diff --git a/.gitattributes b/.gitattributes index 33c66243..f787af87 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -lib/*.js -diff -merge -lib/*.js linguist-generated=true +dist/index.js -diff -merge +dist/index.js linguist-generated=true diff --git a/dist/index.js b/dist/index.js index 2ec6b325bd1000aba1e998286d251c4ffe4171c0..b904df6cd48ed9cfe58d3e4085c5748d9aacf465 100644 GIT binary patch delta 122 zcmaF)fwQ5VYr{g8$=ifpPc~rV+&q<4hH-jcDbt$Ck3|h8zu*+w{F&`A_v9JeZ>J}0 zXOx(}pn!>O^FiSN#^%Gk?T2|8w;$$ZYD_`MO->SRoPN59$rvugzC9mq iNoc!d9g_s}WNukQkm|{=*@~w3)iHrN+p`;)M415k^BiUX diff --git a/lib/auth.js b/lib/auth.js deleted file mode 100644 index f8d795a7..00000000 --- a/lib/auth.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __importStar(require("fs")); -const os = __importStar(require("os")); -const path = __importStar(require("path")); -const core = __importStar(require("@actions/core")); -const io = __importStar(require("@actions/io")); -exports.M2_DIR = '.m2'; -exports.SETTINGS_FILE = 'settings.xml'; -function configAuthentication(id, username, password) { - return __awaiter(this, void 0, void 0, function* () { - if (id && username && password) { - console.log(`creating ${exports.SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password`); - const directory = path.join(os.homedir(), exports.M2_DIR); - yield io.mkdirP(directory); - core.debug(`created directory ${directory}`); - yield write(directory, generate(id, username, password)); - } - else { - core.debug(`no ${exports.SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password`); - } - }); -} -exports.configAuthentication = configAuthentication; -// only exported for testing purposes -function generate(id, username, password) { - return ` - - - - ${id} - ${username} - ${password} - - - - `; -} -exports.generate = generate; -function write(directory, settings) { - return __awaiter(this, void 0, void 0, function* () { - const options = { encoding: 'utf-8' }; - const location = path.join(directory, exports.SETTINGS_FILE); - console.log(`writing ${location}`); - return fs.writeFileSync(location, settings, options); - }); -} diff --git a/lib/setup-java.js b/lib/setup-java.js deleted file mode 100644 index 5372cbb6..00000000 --- a/lib/setup-java.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const core = __importStar(require("@actions/core")); -const installer = __importStar(require("./installer")); -const auth = __importStar(require("./auth")); -const path = __importStar(require("path")); -function run() { - return __awaiter(this, void 0, void 0, function* () { - try { - let version = core.getInput('version'); - if (!version) { - version = core.getInput('java-version', { required: true }); - } - const arch = core.getInput('architecture', { required: true }); - const jdkFile = core.getInput('jdkFile', { required: false }) || ''; - yield installer.getJava(version, arch, jdkFile); - const matchersPath = path.join(__dirname, '..', '.github'); - console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - const id = core.getInput('server-id', { required: false }); - const username = core.getInput('username', { required: false }); - const password = core.getInput('password', { required: false }); - if (id && username && password) { - yield auth.configAuthentication(id, username, password); - } - } - catch (error) { - core.setFailed(error.message); - } - }); -} -run(); From 495409509c39e58df677cd2e8a96dba0f80357d6 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 15 Nov 2019 16:01:13 -0800 Subject: [PATCH 12/55] parent 52c60e0768c1c2fabcab3acf97aa77c5dbc32dfa author Bryan Clark 1573862473 -0800 committer Bryan Clark 1574976093 -0800 Adding maven auth support ignore vscode directory move required parameters to auth module username and password are required from within the auth module now. Update the tests to ensure this is the case. Add generated auth and setup-java Move auth to the bottom of setup Support ids generated and pretty files use server-id instead of ambigous id Use console.log where appropriate Adding maven auth support ignore vscode directory move required parameters to auth module username and password are required from within the auth module now. Update the tests to ensure this is the case. Add generated auth and setup-java Move auth to the bottom of setup generated and pretty files use server-id instead of ambigous id --- lib/auth.js | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 lib/auth.js diff --git a/lib/auth.js b/lib/auth.js new file mode 100644 index 00000000..9b03d1cd --- /dev/null +++ b/lib/auth.js @@ -0,0 +1,62 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(require("fs")); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +const core = __importStar(require("@actions/core")); +const io = __importStar(require("@actions/io")); +exports.M2_DIR = '.m2'; +exports.SETTINGS_FILE = 'settings.xml'; +function configAuthentication(id, username, password) { + return __awaiter(this, void 0, void 0, function* () { + if (id && username && password) { + core.debug(`configAuthentication with ${username} and a password`); + const directory = path.join(os.homedir(), exports.M2_DIR); + yield io.mkdirP(directory); + core.debug(`created directory ${directory}`); + yield write(directory, generate(id, username, password)); + } + else { + core.debug(`no auth without username: ${username} and password: ${password}`); + } + }); +} +exports.configAuthentication = configAuthentication; +// only exported for testing purposes +function generate(id, username, password) { + return ` + + + + ${id} + ${username} + ${password} + + + + `; +} +exports.generate = generate; +function write(directory, settings) { + return __awaiter(this, void 0, void 0, function* () { + const options = { encoding: 'utf-8' }; + const location = path.join(directory, exports.SETTINGS_FILE); + core.debug(`writing ${location}`); + return fs.writeFileSync(location, settings, options); + }); +} From 1085a2b8cf57feaccd2de1c5c7c0429486066290 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 12:54:29 -0800 Subject: [PATCH 13/55] Use console.log where appropriate Update gitattributes and remove lib files --- lib/auth.js | 62 ----------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 lib/auth.js diff --git a/lib/auth.js b/lib/auth.js deleted file mode 100644 index 9b03d1cd..00000000 --- a/lib/auth.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = __importStar(require("fs")); -const os = __importStar(require("os")); -const path = __importStar(require("path")); -const core = __importStar(require("@actions/core")); -const io = __importStar(require("@actions/io")); -exports.M2_DIR = '.m2'; -exports.SETTINGS_FILE = 'settings.xml'; -function configAuthentication(id, username, password) { - return __awaiter(this, void 0, void 0, function* () { - if (id && username && password) { - core.debug(`configAuthentication with ${username} and a password`); - const directory = path.join(os.homedir(), exports.M2_DIR); - yield io.mkdirP(directory); - core.debug(`created directory ${directory}`); - yield write(directory, generate(id, username, password)); - } - else { - core.debug(`no auth without username: ${username} and password: ${password}`); - } - }); -} -exports.configAuthentication = configAuthentication; -// only exported for testing purposes -function generate(id, username, password) { - return ` - - - - ${id} - ${username} - ${password} - - - - `; -} -exports.generate = generate; -function write(directory, settings) { - return __awaiter(this, void 0, void 0, function* () { - const options = { encoding: 'utf-8' }; - const location = path.join(directory, exports.SETTINGS_FILE); - core.debug(`writing ${location}`); - return fs.writeFileSync(location, settings, options); - }); -} From c8f8a264b4ccd08f0ca57e0656f9475f4953cef4 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:13:35 -0800 Subject: [PATCH 14/55] Add publish section to README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 568fd1be..d57bbdd0 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,28 @@ jobs: - run: java -cp java HelloWorldApp ``` +Publising to an Apache Maven Repository: +```yaml +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@master + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + username: ${{ github.actor }} # username for server authentication + password: ${{ github.token }} # password or token for authentication + - name: Build with Maven + run: mvn -B package --file pom.xml + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy +``` + # License The scripts and documentation in this project are released under the [MIT License](LICENSE) From 7d69f8015bb2278c61cd7a41d97c190353d4d452 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:13:43 -0800 Subject: [PATCH 15/55] build index.js --- dist/index.js | Bin 164736 -> 167575 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/index.js b/dist/index.js index b904df6cd48ed9cfe58d3e4085c5748d9aacf465..a2d7b8459dabe05e7eee05a51199a41a5ff48a7a 100644 GIT binary patch delta 193 zcmZo@=bAp3Yl92V}QtAE{hz1$>O#3;39(=fhO8P5-RS*f_nfj>#Ay zB&x$GIlZo&$qT5JZTdzN#@Ew#RzP`|YM7G2!uk7viuN`z86osl>}TYkF3`vnG<`w? MlgReVbxdnn03usSiU0rr delta 59 zcmbO}m#d+jYl92VWEqjSlmGJxZFc6>VQelJYcCgL++HrmG$S7*I(Z9U>GXANOvcmS OcQFZXf8EKnh6MncW){)_ From d1d9006723dec017027b4a6a5d8d5c00edb904e8 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:18:30 -0800 Subject: [PATCH 16/55] Add fields to action.yml --- action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/action.yml b/action.yml index 2bcf1ff4..912a09c4 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,15 @@ inputs: jdkFile: description: 'Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent.' required: false + server-id: + description: 'ID of the distributionManagement repository in the pom.xml file.' + required: false + username: + description: 'Username for authentication to the Apache Maven server.' + required: false + password: + description: 'Passowrd or token for authentication to the Apache Maven server.' + required: false runs: using: 'node12' main: 'dist/index.js' From cda418e54a15b6290a2659671b1b82c78716d1ff Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:22:38 -0800 Subject: [PATCH 17/55] Update index.js --- dist/index.js | Bin 167575 -> 170414 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/index.js b/dist/index.js index a2d7b8459dabe05e7eee05a51199a41a5ff48a7a..182c0797d17dc7cddfc4f45293a8ae68a29edfec 100644 GIT binary patch delta 72 zcmbO}muuZ-t_?CGn|CO&GEV*=%D!1c)Sq#3KA-XA0#Ui?x@}C2lVjNprtd$-C;^ma aZ7$<)FXLz2UdGRqR0UG9{eK(N40Zse1sQz+ delta 33 pcmZ3tnQQu7t_?CG%{DUaHZqLcZDg4Clukb|jY()b<5Z@#EC9@y3y1&! From d2eada383a9872f380c29fb1527b01a5ed7c8c8a Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:48:36 -0800 Subject: [PATCH 18/55] direct ncc to setup-java --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa088e8f..28d0e0be 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "tsc", "format": "prettier --write **/*.ts", "format-check": "prettier --check **/*.ts", - "release": "ncc build && git add -f dist/", + "release": "ncc build lib/setup-java.js && git add -f dist/index.js", "test": "jest" }, "repository": { From ade090c5cf2d27d9efad6eff0763ff6c5f27c632 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 28 Nov 2019 14:48:39 -0800 Subject: [PATCH 19/55] Update index.js --- dist/index.js | Bin 170414 -> 157530 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/index.js b/dist/index.js index 182c0797d17dc7cddfc4f45293a8ae68a29edfec..c01c0f396189c7757106968d7fd57cf4e16e0a7c 100644 GIT binary patch delta 20880 zcmd6PX?Rpsw&=Ha<|37OBvU02ssbT1B#ewd+oK>u4m5b-a8j{`jJpp?#)Sh-aB>oSZ`NCf_SusB{03XQNiwjNBksK3y(Ky zxCINxu?~3j-@)(2!W7;Zqt_YWudkq5uj{MUd*7&>lBn0UIqYtap{>)_Wm({Iv{~H) z13WFhv}^)4Q!1TiPp4o|oKRNgFYWQzx>`z=^6{G1HpgP9q4KawY%h+j;$`7_UGeDA zdhyCCo(b@Lyo&dP0X$H$ay1_bB|BF00(h_qEM2^6;W6U;Y90-}45N$n;?in98Y@Th ziSVdv;ZxwTvxP5($9pY&96VxMd1bD$LR=;OxvZWZmmQX&e8ST8!qUnSNsqPiYIs~~ z<>ONP_1JEr!D4lL0O|rWFM=kyf@KMhnVX{h?O>e8&3ru6egG8)e+3R;Yd4s3UDmc9 zm)q8BEii1+i=%BkPfRp&ooHCY=Zy?(-xv64?Q&bO&zXL16u()+hmQ%Y*EH9>s=Y?E z@d->nu#P7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r^ZXjaNK)*d1hf1n-td< Date: Thu, 28 Nov 2019 14:52:51 -0800 Subject: [PATCH 20/55] Add note about pom.xml to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d57bbdd0..38e9b944 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ jobs: - name: Publish to GitHub Packages Apache Maven run: mvn deploy ``` +See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. # License From d5150a6a6702411fd3470e7e813b49fa0c1cf51a Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 29 Nov 2019 09:26:29 -0800 Subject: [PATCH 21/55] Add publish to Maven Central example to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 38e9b944..9c94aef4 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,15 @@ jobs: run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven run: mvn deploy + - name: Set up Apache Maven Central + uses: actions/setup-java@master + with: # running setup-java again overwrites the settings.xml + java-version: 1.8 + server-id: maven + username: maven_username + password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # password from secrets store + - name: Publish to Apache Maven Central + run: mvn deploy ``` See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. From c1c11bbc1b2c22f330c066444efe1634d201f15a Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 4 Dec 2019 23:22:47 -0500 Subject: [PATCH 22/55] Examples use v1 instead of master Co-Authored-By: Konrad Pabjan --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c94aef4..95fec46b 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Set up JDK 1.8 - uses: actions/setup-java@master + uses: actions/setup-java@v1 with: java-version: 1.8 server-id: github # Value of the distributionManagement/repository/id field of the pom.xml @@ -77,7 +77,7 @@ jobs: - name: Publish to GitHub Packages Apache Maven run: mvn deploy - name: Set up Apache Maven Central - uses: actions/setup-java@master + uses: actions/setup-java@v1 with: # running setup-java again overwrites the settings.xml java-version: 1.8 server-id: maven From bfbec53132fb4c4369c9a47a2bd7aee544453438 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 4 Dec 2019 23:54:21 -0500 Subject: [PATCH 23/55] log when we overwrite the file --- dist/index.js | Bin 157530 -> 157976 bytes src/auth.ts | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index c01c0f396189c7757106968d7fd57cf4e16e0a7c..32058f3255c74a0535b1ad22a57783ccb089023a 100644 GIT binary patch delta 344 zcmcb0j&sH(&W0AoElfvvO*8UyQx$9#3X1ZRQ;UoBQuE59)!jWqJVKq~!~KK2g999$ zUDab1YHAeni}gT?Q!4Ot(@{FRxHnsI^wm*9SAL z6nrwXQ-Mr%g{0CFg|x)XoMMH{G=+l1k_?5^ip=7Y;^~osOx4p5MKTIa&eLI=eoK(a zWV*&PMn2Bu#FFF;1&vhA>4tGk!kmh!ddc}IshV7q8^y)-t+^DC0MJAYh_r&OtwLHc zP-R|mNn&0}v7UdtYlO4U^o=S^B9jFiSf;NLWa5;}FH0>dFUl;*%u9#30>ntm%t@WT zN03Qk`W-VSj_C^L89Aok5oA&ku2x9R16mDK1N2{MNt&*O`t*b-M(ODnbePzu3w&c_ L-7X@;t*EUrlw>TX=rZO;A1LaW>%=Ro_ Date: Thu, 5 Dec 2019 00:41:50 -0500 Subject: [PATCH 24/55] logging options --- dist/index.js | Bin 157976 -> 158003 bytes src/auth.ts | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 32058f3255c74a0535b1ad22a57783ccb089023a..22c99c9fca81ef1365e04872a6ac91b43efd9d4d 100644 GIT binary patch delta 110 zcmbPniF5NM&W0AoEliF=;tJ)NB^e6&1tppJdBqAU)lk-S2O%c;>1jetvD3c_F_nwy z>no(BrX`l#Pliu_V7ECPD?+7soPOs)?;@N&l In8_^^08eNnivR!s delta 80 zcmV-W0I&bE(g~Q-34nwFv;sjAmst`59+%)w0tc6Q69OfdoDu>!2q9%IV{c?-DVGs6 m0v7^hJD0-}0*IF&&jARRdJ_Utlke*Wmk;&<2Dj}K0!CFKy&6XV diff --git a/src/auth.ts b/src/auth.ts index 875c6b4d..2e83edee 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -46,9 +46,9 @@ export function generate(id: string, username: string, password: string) { async function write(directory: string, settings: string) { const options = {encoding: 'utf-8', flag: 'wx'}; // 'wx': Like 'w' but fails if path exists const location = path.join(directory, SETTINGS_FILE); - console.log(`writing ${location}`); + console.log(`writing ${location} with options ${options}`); try { - return fs.writeFileSync(location, settings, options); + fs.writeFileSync(location, settings, options); } catch (e) { if (e.code == fs.constants.O_EXCL) { console.log(`overwriting existing file ${location}`); From 96236d7072cf35fe951ee34da7850be147cd261d Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 5 Dec 2019 00:43:41 -0500 Subject: [PATCH 25/55] return but shoudl still fail --- dist/index.js | Bin 158003 -> 158010 bytes src/auth.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 22c99c9fca81ef1365e04872a6ac91b43efd9d4d..3f1a2e3aa06f4a0985c1e2d1d6832a0909bc8c39 100644 GIT binary patch delta 29 lcmdmdiF4N_&W0AoEllM?(;xUTu}`lQW>VcgM~G>97yz`N3e*4q delta 24 gcmdmWiF5NM&W0AoEllM?(;I}DRJSh{VwxTX0DjX66aWAK diff --git a/src/auth.ts b/src/auth.ts index 2e83edee..f0d11972 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -48,7 +48,7 @@ async function write(directory: string, settings: string) { const location = path.join(directory, SETTINGS_FILE); console.log(`writing ${location} with options ${options}`); try { - fs.writeFileSync(location, settings, options); + return fs.writeFileSync(location, settings, options); } catch (e) { if (e.code == fs.constants.O_EXCL) { console.log(`overwriting existing file ${location}`); From 2b05c0051416301757a657e4d41bd5a6c987bda1 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 5 Dec 2019 00:45:56 -0500 Subject: [PATCH 26/55] logging code --- dist/index.js | Bin 158010 -> 158087 bytes src/auth.ts | 1 + 2 files changed, 1 insertion(+) diff --git a/dist/index.js b/dist/index.js index 3f1a2e3aa06f4a0985c1e2d1d6832a0909bc8c39..e31c4d7686c909eb8f1c36f3e2880effec951237 100644 GIT binary patch delta 76 zcmdmWiL?DOXG06)7N+aM)7M^P Date: Thu, 5 Dec 2019 00:48:15 -0500 Subject: [PATCH 27/55] strringify the logs --- dist/index.js | Bin 158087 -> 158099 bytes src/auth.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index e31c4d7686c909eb8f1c36f3e2880effec951237..0ff2524dbc4de10bc6fc9d2ce5d803b8b102b51a 100644 GIT binary patch delta 45 zcmZp_%sKfoXG06)7N#e{lBq>S`9%sU)n38=etN|vMVWc&nQ4_8shZnA3NuX$1pt#$ B5i9@z delta 33 mcmbPynX~;eXG06)7N#e{yvg|~sR}C9sd^yB_P@eR(?S8?7!1w; diff --git a/src/auth.ts b/src/auth.ts index 1e0c4f86..f7162618 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -55,7 +55,7 @@ async function write(directory: string, settings: string) { // default flag is 'w' return fs.writeFileSync(location, settings, {encoding: 'utf-8'}); } - console.log(`code ${e.code} and O_EXCL ${fs.constants.O_EXCL}`); + console.log(`error ${JSON.stringify(e)} and O_EXCL ${fs.constants.O_EXCL}`); throw e; } } From 797045350f7883bf56a4ec7728e71f079f9676d9 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 5 Dec 2019 00:54:26 -0500 Subject: [PATCH 28/55] code == EEXIST --- dist/index.js | Bin 158099 -> 157999 bytes src/auth.ts | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0ff2524dbc4de10bc6fc9d2ce5d803b8b102b51a..92274cdc22e617b72b442abef53bf4a62269e082 100644 GIT binary patch delta 42 ycmbPynRERm&W0AoElf{^IFwvnBRqpcl%^+YF^NnTaA27(Ak1`pyMYK(awq^iD-9t4 delta 122 zcmZ2~iF5L0&W0AoElf{^gwu-klJoP5OA_-+iuL^CT_c=*ra!c05}7REz%rdxnCbZR zwHFzA?Nf`2@{1Hys=b2!{q%}UiZb)kGt(+HQZ;K867y0NAR2-4Sd6Pp(6rvZUzn*N F6ab>_D Date: Fri, 6 Dec 2019 14:25:41 -0500 Subject: [PATCH 29/55] Use $HOME directory --- src/auth.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 6068341f..09a1f782 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -16,8 +16,7 @@ export async function configAuthentication( console.log( `creating ${SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password` ); - const home: string = process.env['GITHUB_WORKSPACE'] || os.homedir(); - const directory: string = path.join(home, M2_DIR); + const directory: string = path.join(os.homedir(), M2_DIR); await io.mkdirP(directory); core.debug(`created directory ${directory}`); await write(directory, generate(id, username, password)); From 5e29577d7bda754152759cac220bfb4e1967ea40 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:28:17 -0500 Subject: [PATCH 30/55] Remote options from log --- src/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index 09a1f782..7ebbe83f 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -45,7 +45,7 @@ export function generate(id: string, username: string, password: string) { async function write(directory: string, settings: string) { const options = {encoding: 'utf-8', flag: 'wx'}; // 'wx': Like 'w' but fails if path exists const location = path.join(directory, SETTINGS_FILE); - console.log(`writing ${location} with options ${options}`); + console.log(`writing ${location}`); try { return fs.writeFileSync(location, settings, options); } catch (e) { From 8940139ee84ca9e5eeaa73fc5c7cf5e9947a14b8 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:28:34 -0500 Subject: [PATCH 31/55] Be explicit about second flag --- src/auth.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 7ebbe83f..2e6605df 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -50,9 +50,8 @@ async function write(directory: string, settings: string) { return fs.writeFileSync(location, settings, options); } catch (e) { if (e.code == "EEXIST") { - console.log(`overwriting existing file ${location}`); - // default flag is 'w' - return fs.writeFileSync(location, settings, {encoding: 'utf-8'}); + console.warn(`overwriting existing file ${location}`); + return fs.writeFileSync(location, settings, {encoding: 'utf-8', flag: 'w'}); } throw e; } From 4b6ff8caf0490546ece91408c70199e239e79353 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:32:51 -0500 Subject: [PATCH 32/55] Format auth --- src/auth.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 2e6605df..1001b2cf 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -49,9 +49,12 @@ async function write(directory: string, settings: string) { try { return fs.writeFileSync(location, settings, options); } catch (e) { - if (e.code == "EEXIST") { + if (e.code == 'EEXIST') { console.warn(`overwriting existing file ${location}`); - return fs.writeFileSync(location, settings, {encoding: 'utf-8', flag: 'w'}); + return fs.writeFileSync(location, settings, { + encoding: 'utf-8', + flag: 'w' + }); } throw e; } From 540a98ac020a18cc64370d8c5a5ade3f026164ff Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:33:05 -0500 Subject: [PATCH 33/55] Wrap long lines in action.yml --- action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 912a09c4..0034c965 100644 --- a/action.yml +++ b/action.yml @@ -1,9 +1,11 @@ name: 'Setup Java JDK' -description: 'Set up a specific version of the Java JDK and add the command-line tools to the PATH' +description: 'Set up a specific version of the Java JDK and add the command-line tools + to the PATH' author: 'GitHub' inputs: java-version: - description: 'The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x)' + description: 'The Java version to make available on the path. Takes a whole or + semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x)' required: true java-package: description: 'The package type (jre, jdk, jdk+fx)' @@ -14,7 +16,8 @@ inputs: required: false default: 'x64' jdkFile: - description: 'Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent.' + description: 'Path to where the compressed JDK is located. The path could be + in your source repository or a local path on the agent.' required: false server-id: description: 'ID of the distributionManagement repository in the pom.xml file.' From dbeab7ccf21319c27d1b5bccc1661f7124e0b82f Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:35:32 -0500 Subject: [PATCH 34/55] Remove trailing spaces and long lines --- action.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 0034c965..c82b0ec8 100644 --- a/action.yml +++ b/action.yml @@ -1,11 +1,11 @@ name: 'Setup Java JDK' -description: 'Set up a specific version of the Java JDK and add the command-line tools - to the PATH' +description: 'Set up a specific version of the Java JDK and add the + command-line tools to the PATH' author: 'GitHub' inputs: java-version: - description: 'The Java version to make available on the path. Takes a whole or - semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x)' + description: 'The Java version to make available on the path. Takes a whole + or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x)' required: true java-package: description: 'The package type (jre, jdk, jdk+fx)' @@ -16,17 +16,19 @@ inputs: required: false default: 'x64' jdkFile: - description: 'Path to where the compressed JDK is located. The path could be - in your source repository or a local path on the agent.' + description: 'Path to where the compressed JDK is located. The path could + be in your source repository or a local path on the agent.' required: false server-id: - description: 'ID of the distributionManagement repository in the pom.xml file.' + description: 'ID of the distributionManagement repository in the pom.xml + file.' required: false username: description: 'Username for authentication to the Apache Maven server.' required: false password: - description: 'Passowrd or token for authentication to the Apache Maven server.' + description: 'Passowrd or token for authentication to the Apache Maven + server.' required: false runs: using: 'node12' From b7e70417f9c68e1094a7086d3dcce5ee28353440 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:36:32 -0500 Subject: [PATCH 35/55] Remove last trailing space --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c82b0ec8..eaf3aebd 100644 --- a/action.yml +++ b/action.yml @@ -2,7 +2,7 @@ name: 'Setup Java JDK' description: 'Set up a specific version of the Java JDK and add the command-line tools to the PATH' author: 'GitHub' -inputs: +inputs: java-version: description: 'The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x)' From 6ae690c576a37d52f0a1d35f4d8f15ca4b233ae0 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:46:35 -0500 Subject: [PATCH 36/55] Add test for overwrite --- __tests__/auth.test.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 8e5efd4e..ec54bce2 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -42,7 +42,26 @@ describe('auth tests', () => { ); }, 100000); - it('does not create settings.xml without username and / or password', async () => { + it('overwrites existing settings.xml files', async () => { + const id = 'packages'; + const username = 'bluebottle'; + const password = 'SingleOrigin'; + + fs.mkdirSync(m2Dir, {recursive: true}); + fs.writeFileSync(settingsFile, "FAKE FILE"); + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + + await auth.configAuthentication(id, username, password); + + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate(id, username, password) + ); + }, 100000); + + it('does not create settings.xml without required parameters', async () => { await auth.configAuthentication('FOO', '', ''); expect(fs.existsSync(m2Dir)).toBe(false); From f33acc6b4f056fff50e7b30f9ccb5c4571191c82 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:46:43 -0500 Subject: [PATCH 37/55] build release --- dist/index.js | Bin 157999 -> 157938 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/index.js b/dist/index.js index 92274cdc22e617b72b442abef53bf4a62269e082..7d9c7bb1b3304b693ee25dae641e091ea1d90009 100644 GIT binary patch delta 147 zcmZ2~iSyG%&W0AoElfvvr}ObKiSgtY>t*EUrlw>TX=rZO;A4_xnI0*`)Wf0f>Kfr0 z9HKt`p)HfhWB~^jj{KZdz4FAOyy-l`OxDvC&NFgMuNPucnI80+QA{W`FF8LYGcVmr zLA|sjP1izQXY$8FQO>lSM37Lq`s9lRBGV5jF>y{8@L*z@o?ybnxBZMTQ*tN(fMG5J delta 200 zcmex#k#qee&W0AoElfvvO*8UyQx$9#3X1ZRQ;UoBQuE59)!jWqJVKq~!~KK2g999$ zUDab1YHAeni}gT?Q!=GFiZZg*`tfRWBz$efnl0CTlT$eT9_Nw8YY!5{0y!#B_zs sVg>bb^~oPqC8mEBVp0=QNX<*mPsz+nw^C3qElJb0P~To4%+wSL03ljJ^#A|> From ddf78adea0a00c0f59c71944fbdd38b35921889d Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 14:50:30 -0500 Subject: [PATCH 38/55] Add note about $HOME directory usage --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 95fec46b..2f6521dc 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,9 @@ jobs: - name: Publish to Apache Maven Central run: mvn deploy ``` + +***NOTE: The `settings.xml` is created in the Actons $HOME directory by default and will overwrite existing files.*** + See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. # License From 70aff31eb73fad306647407eb2135e5271071c30 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 15:31:28 -0500 Subject: [PATCH 39/55] Apply suggestions from code review Co-Authored-By: Konrad Pabjan --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index eaf3aebd..1f952a87 100644 --- a/action.yml +++ b/action.yml @@ -24,11 +24,11 @@ inputs: file.' required: false username: - description: 'Username for authentication to the Apache Maven server.' + description: 'Username for authentication to the Apache Maven repository.' required: false password: - description: 'Passowrd or token for authentication to the Apache Maven - server.' + description: 'Password or token for authentication to the Apache Maven + repository.' required: false runs: using: 'node12' From 203550b5425c7f308974addc549848e67d7cfd70 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 16:21:27 -0500 Subject: [PATCH 40/55] Add Gradle example to README --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f6521dc..a6acabf7 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ jobs: - run: java -cp java HelloWorldApp ``` -Publising to an Apache Maven Repository: +Publishing using Apache Maven: ```yaml jobs: build: @@ -91,6 +91,33 @@ jobs: See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. +Publishing using Gradle: +```yaml +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + + - name: Build with Gradle + run: gradle build + + - name: Publish to GitHub Packages + run: gradle publish + env: + USERNAME: ${{ github.actor }} + PASSWORD: ${{ secrets.GITHUB_TOKEN }} +``` + +***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`..*** + +See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. + # License The scripts and documentation in this project are released under the [MIT License](LICENSE) From 8ccac94e40f51d001ee914a334172da354e5780b Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Mon, 9 Dec 2019 12:16:15 -0500 Subject: [PATCH 41/55] README Small spelling fix. Also some rewording Co-Authored-By: Konrad Pabjan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6acabf7..24fc35f1 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ jobs: run: mvn deploy ``` -***NOTE: The `settings.xml` is created in the Actons $HOME directory by default and will overwrite existing files.*** +***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten*** See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. From 9d56a3bd350a62870fa2229f7513bb2b96d8afa6 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 09:26:42 -0800 Subject: [PATCH 42/55] prettier fixup --- __tests__/auth.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index ec54bce2..3fa739c8 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -48,7 +48,7 @@ describe('auth tests', () => { const password = 'SingleOrigin'; fs.mkdirSync(m2Dir, {recursive: true}); - fs.writeFileSync(settingsFile, "FAKE FILE"); + fs.writeFileSync(settingsFile, 'FAKE FILE'); expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); From 551e2a2770b8079e2141a6b4728a7b96ae33ae50 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 09:26:51 -0800 Subject: [PATCH 43/55] sanitzie XML characters --- __tests__/auth.test.ts | 18 ++++++++++++++++++ dist/index.js | Bin 157938 -> 158179 bytes src/auth.ts | 15 ++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 3fa739c8..7134e5cc 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -82,4 +82,22 @@ describe('auth tests', () => { expect(fs.existsSync(m2Dir)).toBe(false); expect(fs.existsSync(settingsFile)).toBe(false); }, 100000); + + it('escapes invalid XML inputs', () => { + const id = 'packages'; + const username = 'bluebottle'; + const password = '&<>"\'\'"><&'; + + expect(auth.generate(id, username, password)).toEqual(` + + + + ${id} + ${username} + &<>"''"><& + + + + `); + }); }); diff --git a/dist/index.js b/dist/index.js index 7d9c7bb1b3304b693ee25dae641e091ea1d90009..c7b1f986e251ef46b80e725ac2b5ef0c6a671f10 100644 GIT binary patch delta 297 zcmex#k@N9o&W0AoElgGX^=YMf$t9Wjc?zk;$%zH25xzbeWr;bZshSGaTna!?lv+|+ zl&1g|0}Frz^@>spauSnMHT2c=({&Wo)e>_HtkpHK$lE~Vb4svF+XX=6({acvL8J>y z^KmFphuU9|UktRtnyYqtB|p{&W0AoElgGX)4c?k=Bj6=)Y|B0rr2>Qz=2I^acWUsVs5IPN;Ql*T}6;d UnWG@FxVSvOC}n$;AX8@q02mP&+W-In diff --git a/src/auth.ts b/src/auth.ts index 1001b2cf..ca43c201 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -27,15 +27,24 @@ export async function configAuthentication( } } +function escapeXML(value: string) { + return value + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + // only exported for testing purposes export function generate(id: string, username: string, password: string) { return ` - ${id} - ${username} - ${password} + ${escapeXML(id)} + ${escapeXML(username)} + ${escapeXML(password)} From 4757680fc9fb500faa11db2c790410b69e0d6dc9 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 09:37:07 -0800 Subject: [PATCH 44/55] Add Shared Runner to README Be the docs for the feature you want to see. #docsdrivendevelopment --- README.md | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 24fc35f1..1e376b55 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This action sets up a java environment for use in actions by: See [action.yml](action.yml) -Basic: +## Basic ```yaml steps: - uses: actions/checkout@v1 @@ -25,7 +25,7 @@ steps: - run: java -cp java HelloWorldApp ``` -From local file: +## Local file ```yaml steps: - uses: actions/checkout@v1 @@ -37,7 +37,7 @@ steps: - run: java -cp java HelloWorldApp ``` -Matrix Testing: +## Matrix Testing ```yaml jobs: build: @@ -56,7 +56,7 @@ jobs: - run: java -cp java HelloWorldApp ``` -Publishing using Apache Maven: +## Publishing using Apache Maven ```yaml jobs: build: @@ -91,7 +91,7 @@ jobs: See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. -Publishing using Gradle: +## Publishing using Gradle ```yaml jobs: @@ -118,6 +118,32 @@ jobs: See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. +## Apache Maven within a Shared Runner + +When using an Actions shared runner the default `$HOME` directory can be shared by a number of workflows at the same time which could overwrite existing settings file. Setting the `m2-home` variable allows you to choose a unique location for your settings file. + +```yaml +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 for Shared Runner + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + username: ${{ github.actor }} # username for server authentication + password: ${{ github.token }} # password or token for authentication + m2-home: ${{ $GITHUB_WORKSPACE }} # location of the .m2 directory + - name: Build with Maven + run: mvn -B package --file pom.xml + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy +``` + # License The scripts and documentation in this project are released under the [MIT License](LICENSE) From ae11e1a1b65b1ac2350dbf764d37e0970ef02725 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 10:03:33 -0800 Subject: [PATCH 45/55] Allow for alternate settings.xml file location Use the m2-home to specify a new location for the settings.xml file --- README.md | 4 ++-- __tests__/auth.test.ts | 25 +++++++++++++++++++++++++ dist/index.js | Bin 158179 -> 158387 bytes src/auth.ts | 7 ++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e376b55..a98d883a 100644 --- a/README.md +++ b/README.md @@ -137,11 +137,11 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml username: ${{ github.actor }} # username for server authentication password: ${{ github.token }} # password or token for authentication - m2-home: ${{ $GITHUB_WORKSPACE }} # location of the .m2 directory + m2-home: ${{ $GITHUB_WORKSPACE }} # location for the settings.xml file - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven - run: mvn deploy + run: mvn deploy -s ${{ $GITHUB_WORKSPACE }}/settings.xml ``` # License diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 7134e5cc..ce13ef79 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -28,6 +28,31 @@ describe('auth tests', () => { } }, 100000); + it('creates settings.xml in alternate locations', async () => { + const id = 'packages'; + const username = 'bluebottle'; + const password = 'SingleOrigin'; + + const altHome = path.join(__dirname, 'runner', 'settings'); + const altSettingsFile = path.join(altHome, auth.SETTINGS_FILE); + process.env[`INPUT_M2-HOME`] = altHome; + await io.rmRF(altHome); // ensure it doesn't already exist + + await auth.configAuthentication(id, username, password); + + expect(fs.existsSync(m2Dir)).toBe(false); + expect(fs.existsSync(settingsFile)).toBe(false); + + expect(fs.existsSync(altHome)).toBe(true); + expect(fs.existsSync(altSettingsFile)).toBe(true); + expect(fs.readFileSync(altSettingsFile, 'utf-8')).toEqual( + auth.generate(id, username, password) + ); + + delete process.env[`INPUT_M2-HOME`]; + await io.rmRF(altHome); + }, 100000); + it('creates settings.xml with username and password', async () => { const id = 'packages'; const username = 'bluebottle'; diff --git a/dist/index.js b/dist/index.js index c7b1f986e251ef46b80e725ac2b5ef0c6a671f10..f4ff8d1035d31a253d4aa6dc99c16529974084d0 100644 GIT binary patch delta 235 zcmZ{dF$%&!6htwV3c15{Nk9`wX=Cjftd{t77n1#9^MeS27T&>gh=QG$5Kmy?B`n-j z+Bi%z@Mh+DADkb9{h@aWZs9J=u-0Uuyh|Zxl@O{NB^OEzTbKq-O@&z+TA*zRY|9Nq zEBP|9Wu(5eFpdggw@HThk^f-P>HO}?YfF+G8giH|qGST7?#H#H@*NJCR+`*uF2KhXfI C9T7DE diff --git a/src/auth.ts b/src/auth.ts index ca43c201..9cfa69a7 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -16,7 +16,12 @@ export async function configAuthentication( console.log( `creating ${SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password` ); - const directory: string = path.join(os.homedir(), M2_DIR); + // when an alternate m2 location is specified use only that location (no .m2 directory) + // otherwise use the home/.m2/ path + const directory: string = path.join( + core.getInput('m2-home') || os.homedir(), + core.getInput('m2-home') ? '' : M2_DIR + ); await io.mkdirP(directory); core.debug(`created directory ${directory}`); await write(directory, generate(id, username, password)); From ce88feea9475f3d2dae95300fed6de40719d1c64 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 13:02:21 -0800 Subject: [PATCH 46/55] Move to settings-path --- README.md | 8 ++++---- __tests__/auth.test.ts | 4 ++-- action.yml | 3 +++ dist/index.js | Bin 158387 -> 158399 bytes src/auth.ts | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a98d883a..ca4d07e7 100644 --- a/README.md +++ b/README.md @@ -118,9 +118,9 @@ jobs: See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. -## Apache Maven within a Shared Runner +## Apache Maven within a self-hosted runner -When using an Actions shared runner the default `$HOME` directory can be shared by a number of workflows at the same time which could overwrite existing settings file. Setting the `m2-home` variable allows you to choose a unique location for your settings file. +When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file. ```yaml jobs: @@ -137,11 +137,11 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml username: ${{ github.actor }} # username for server authentication password: ${{ github.token }} # password or token for authentication - m2-home: ${{ $GITHUB_WORKSPACE }} # location for the settings.xml file + settings-path: ./config # location for the settings.xml file - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s ${{ $GITHUB_WORKSPACE }}/settings.xml + run: mvn deploy -s ./config/settings.xml ``` # License diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index ce13ef79..1d5cee92 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -35,7 +35,7 @@ describe('auth tests', () => { const altHome = path.join(__dirname, 'runner', 'settings'); const altSettingsFile = path.join(altHome, auth.SETTINGS_FILE); - process.env[`INPUT_M2-HOME`] = altHome; + process.env[`INPUT_SETTINGS-PATH`] = altHome; await io.rmRF(altHome); // ensure it doesn't already exist await auth.configAuthentication(id, username, password); @@ -49,7 +49,7 @@ describe('auth tests', () => { auth.generate(id, username, password) ); - delete process.env[`INPUT_M2-HOME`]; + delete process.env[`INPUT_SETTINGS-PATH`]; await io.rmRF(altHome); }, 100000); diff --git a/action.yml b/action.yml index 1f952a87..a67838c4 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,9 @@ inputs: description: 'Password or token for authentication to the Apache Maven repository.' required: false + settings-path: + description: 'Path to where the settings.xml file will be written.' + required: false runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index f4ff8d1035d31a253d4aa6dc99c16529974084d0..cad273103c188f739219c0e45d8585ad934be6bc 100644 GIT binary patch delta 52 wcmdmdm2>}9&W0AoEljn1yv3;{C7F5Y#kvKFB^lFO_?VPYg|@HbV`7Z~034hXNdN!< delta 40 pcmdmgm2>k|&W0AoEljn1?72p|8Tq-X)4TYXlwq9hyZD$`V*oNs4Wj@6 diff --git a/src/auth.ts b/src/auth.ts index 9cfa69a7..f50ab7d0 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -19,8 +19,8 @@ export async function configAuthentication( // when an alternate m2 location is specified use only that location (no .m2 directory) // otherwise use the home/.m2/ path const directory: string = path.join( - core.getInput('m2-home') || os.homedir(), - core.getInput('m2-home') ? '' : M2_DIR + core.getInput('settings-path') || os.homedir(), + core.getInput('settings-path') ? '' : M2_DIR ); await io.mkdirP(directory); core.debug(`created directory ${directory}`); From 2e749e50a69d4402354c38df0dc5b9e021cae9d8 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Tue, 10 Dec 2019 14:25:15 -0800 Subject: [PATCH 47/55] Update settings-path for github.workspace --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ca4d07e7..e725c559 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ jobs: See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. -## Apache Maven within a self-hosted runner +## Apache Maven with a settings path When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file. @@ -137,11 +137,11 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml username: ${{ github.actor }} # username for server authentication password: ${{ github.token }} # password or token for authentication - settings-path: ./config # location for the settings.xml file + settings-path: ${{ github.workspace }} # location for the settings.xml file - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s ./config/settings.xml + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml ``` # License From 998be8d08f04ae06317cde62fff9b14edd5df851 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Wed, 18 Dec 2019 11:05:01 -0800 Subject: [PATCH 48/55] Add default to settings-path description Co-Authored-By: Chris Patterson --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a67838c4..c6c52843 100644 --- a/action.yml +++ b/action.yml @@ -31,7 +31,7 @@ inputs: repository.' required: false settings-path: - description: 'Path to where the settings.xml file will be written.' + description: 'Path to where the settings.xml file will be written. Default is ~/.m2.' required: false runs: using: 'node12' From 6924f73ee016582f21bae0cec5f0e818642eb1d5 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 19 Dec 2019 08:52:26 -0800 Subject: [PATCH 49/55] Address latest review feedback --- README.md | 18 ++++++++++++------ action.yml | 4 ++-- dist/index.js | Bin 158399 -> 158314 bytes package.json | 5 +++-- src/auth.ts | 22 +++++++++------------- src/setup-java.ts | 6 ++++-- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e725c559..f6d6a44d 100644 --- a/README.md +++ b/README.md @@ -72,22 +72,26 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml username: ${{ github.actor }} # username for server authentication password: ${{ github.token }} # password or token for authentication + - name: Build with Maven run: mvn -B package --file pom.xml + - name: Publish to GitHub Packages Apache Maven run: mvn deploy + - name: Set up Apache Maven Central uses: actions/setup-java@v1 with: # running setup-java again overwrites the settings.xml java-version: 1.8 server-id: maven - username: maven_username - password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # password from secrets store + server-username: maven_username + server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # password from secrets store + - name: Publish to Apache Maven Central run: mvn deploy ``` -***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten*** +***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.*** See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. @@ -114,7 +118,7 @@ jobs: PASSWORD: ${{ secrets.GITHUB_TOKEN }} ``` -***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`..*** +***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`.*** See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. @@ -135,11 +139,13 @@ jobs: with: java-version: 1.8 server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - username: ${{ github.actor }} # username for server authentication - password: ${{ github.token }} # password or token for authentication + server-username: ${{ github.actor }} # username for server authentication + server-password: ${{ github.token }} # password or token for authentication settings-path: ${{ github.workspace }} # location for the settings.xml file + - name: Build with Maven run: mvn -B package --file pom.xml + - name: Publish to GitHub Packages Apache Maven run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml ``` diff --git a/action.yml b/action.yml index c6c52843..df1a2c15 100644 --- a/action.yml +++ b/action.yml @@ -23,10 +23,10 @@ inputs: description: 'ID of the distributionManagement repository in the pom.xml file.' required: false - username: + server-username: description: 'Username for authentication to the Apache Maven repository.' required: false - password: + server-password: description: 'Password or token for authentication to the Apache Maven repository.' required: false diff --git a/dist/index.js b/dist/index.js index cad273103c188f739219c0e45d8585ad934be6bc..e9e7cc342516b5c869d6fdc54ed32521dd8d39af 100644 GIT binary patch delta 336 zcmdmgmGjjV&J7D$m@Nzqo0qU`U&6w;$B)U_aPmUq!0jv8nc}#o=Lj=7Ojp^+D8!kQ zpPX2dnV+XQT_J)=WO{`Nll63+XN*;x-Omf@fgBcAOw`<2Sy4Hg%g;}(ddHS3P#w2D-Bjf3ek&H&n#>R%z z_i!^=ZqJWo^ktr&7sJRteNPOdFNDPz%eZcOLmU&YU}lO!O^rfnacWUsVs0vsJ>5H& zQFgL`1B+9BPO4scVo{!kx?@g`g0TWnO<8J@u102x4qStdLSkNuLP272ae01Gil#zh zQK~{wYGG++QEG~w`t*mUOp=q|zvh}O<;XStbSz{1_Fxt!Cg$zEqD(N^&J7D$m`#j~o0qU`U&6w;$8Y=W1V#f!CL`m?3ylM}*V`~{W}Ytolre+f z+{98-)0!(eKd-n%A+dCNp(B$TvxSlQ_U%s@+n6~@i&Km85_40hFL=qQI(`0gMz-nY zFBzq#&v?nWZu)~)jK$keB{I6zGnt!AUSJ#qGPqxDd+=*UCT1ohbA(;n)4~~7vrqqL zz{KO7nwOlPl9`uorJ!C~lBR2+uA`8alL+FLSEwu0S}W-5gPB$eKAG96K&HAvQfY}o zT4H8Su|j5=LP26lhC*sZW^qaJbf$Pl|LHg48Fi*RKVuY{oTtM!T_k}~jXl4hBopYP z=^Nr1MLCiaOOi7bG*YKK@G*%9rRo8#PgStBRZw?zjqnT(QJ-$8#3V9Vz=36YLp-DP z^fOFM9Mcb6V&s@EmcVE Date: Thu, 19 Dec 2019 11:28:11 -0800 Subject: [PATCH 50/55] Try env variables --- README.md | 18 ++++++++------ __tests__/auth.test.ts | 54 +++++++++++++++++++++++++---------------- action.yml | 7 +++--- dist/index.js | Bin 158314 -> 158193 bytes src/auth.ts | 51 ++++++++++++++++++++------------------ src/setup-java.ts | 6 +---- 6 files changed, 75 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index f6d6a44d..977a4bb6 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - username: ${{ github.actor }} # username for server authentication - password: ${{ github.token }} # password or token for authentication + env: + GITHUB_TOKEN: ${{ github.token }} - name: Build with Maven run: mvn -B package --file pom.xml @@ -83,9 +82,12 @@ jobs: uses: actions/setup-java@v1 with: # running setup-java again overwrites the settings.xml java-version: 1.8 - server-id: maven - server-username: maven_username - server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} # password from secrets store + server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username below + server-password: MAVEN_CENTRAL_TOKEN # env variable for token below + env: + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_USERNAME: maven_username123 - name: Publish to Apache Maven Central run: mvn deploy @@ -139,9 +141,9 @@ jobs: with: java-version: 1.8 server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - server-username: ${{ github.actor }} # username for server authentication - server-password: ${{ github.token }} # password or token for authentication settings-path: ${{ github.workspace }} # location for the settings.xml file + env: + GITHUB_TOKEN: ${{ github.token }} - name: Build with Maven run: mvn -B package --file pom.xml diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 1d5cee92..5a31e277 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -30,8 +30,8 @@ describe('auth tests', () => { it('creates settings.xml in alternate locations', async () => { const id = 'packages'; - const username = 'bluebottle'; - const password = 'SingleOrigin'; + const username = 'UNAMI'; + const password = 'TOLKIEN'; const altHome = path.join(__dirname, 'runner', 'settings'); const altSettingsFile = path.join(altHome, auth.SETTINGS_FILE); @@ -55,8 +55,8 @@ describe('auth tests', () => { it('creates settings.xml with username and password', async () => { const id = 'packages'; - const username = 'bluebottle'; - const password = 'SingleOrigin'; + const username = 'UNAME'; + const password = 'TOKEN'; await auth.configAuthentication(id, username, password); @@ -69,8 +69,8 @@ describe('auth tests', () => { it('overwrites existing settings.xml files', async () => { const id = 'packages'; - const username = 'bluebottle'; - const password = 'SingleOrigin'; + const username = 'USERNAME'; + const password = 'PASSWORD'; fs.mkdirSync(m2Dir, {recursive: true}); fs.writeFileSync(settingsFile, 'FAKE FILE'); @@ -87,30 +87,42 @@ describe('auth tests', () => { }, 100000); it('does not create settings.xml without required parameters', async () => { - await auth.configAuthentication('FOO', '', ''); + await auth.configAuthentication('FOO'); - expect(fs.existsSync(m2Dir)).toBe(false); - expect(fs.existsSync(settingsFile)).toBe(false); + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate('FOO') + ); - await auth.configAuthentication('', 'BAR', ''); + await auth.configAuthentication(undefined, 'BAR', undefined); - expect(fs.existsSync(m2Dir)).toBe(false); - expect(fs.existsSync(settingsFile)).toBe(false); + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate(undefined, 'BAR', undefined) + ); - await auth.configAuthentication('', '', 'BAZ'); + await auth.configAuthentication(undefined, undefined, 'BAZ'); - expect(fs.existsSync(m2Dir)).toBe(false); - expect(fs.existsSync(settingsFile)).toBe(false); + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate(undefined, undefined, 'BAZ') + ); - await auth.configAuthentication('', '', ''); + await auth.configAuthentication(); - expect(fs.existsSync(m2Dir)).toBe(false); - expect(fs.existsSync(settingsFile)).toBe(false); + expect(fs.existsSync(m2Dir)).toBe(true); + expect(fs.existsSync(settingsFile)).toBe(true); + expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( + auth.generate(undefined, undefined, undefined) + ); }, 100000); it('escapes invalid XML inputs', () => { const id = 'packages'; - const username = 'bluebottle'; + const username = 'USER'; const password = '&<>"\'\'"><&'; expect(auth.generate(id, username, password)).toEqual(` @@ -118,8 +130,8 @@ describe('auth tests', () => { ${id} - ${username} - &<>"''"><& + \${env.${username}} + \${env.&<>"''"><&} diff --git a/action.yml b/action.yml index df1a2c15..d310ebdb 100644 --- a/action.yml +++ b/action.yml @@ -24,11 +24,12 @@ inputs: file.' required: false server-username: - description: 'Username for authentication to the Apache Maven repository.' + description: 'Environment variable name for the username for authentication + to the Apache Maven repository.' required: false server-password: - description: 'Password or token for authentication to the Apache Maven - repository.' + description: 'Environment variable name for password or token for + authentication to the Apache Maven repository.' required: false settings-path: description: 'Path to where the settings.xml file will be written. Default is ~/.m2.' diff --git a/dist/index.js b/dist/index.js index e9e7cc342516b5c869d6fdc54ed32521dd8d39af..be71c59d80e1f31b9dd23c4288afb719de1b5290 100644 GIT binary patch delta 582 zcmaELh4bTO&W0_F%OdJiD+=<9N{aPdT-_W)eL~_rT@-8;)YCIdGD?%wt+~*pLxWv| z{2YBj*=+GlIc-97zL*PiDDF)zG^!o&vb=oMy=_7(TsN6 z)nXW38RM}yn3|rRULVU?E*qm#otjss2PBJ=6AMx!e0?-ve$%X-&K<|7h)oI1kD9gH e9pe~Vxih`P<PboQC?zhDu`W>SX^A5 zUz9TaY&@gH^cRtgHu^en1y%|w)iA}iItqz-DGG^j9SNG&Tna!iy)=q3WBSb~MuW*+ zx?I!wqZwPL*Mu=~P5--%k$d{mXhz}bJ3ATqryq`H)P_iWiDtBzE|I{fJbiyBBWFxP zUOv#C)QW=qqLO00VAqfkPe1qIcsEZU*II@0%#w`!(h>!rlgmD-6)39o^iTB3@{ij#xj;o_lsi`o1PlSs2~cow>UYmAT`3*M*|iVn%ft} zF}8HeWu_@;;0dsUOiUt^`wZEp>%3yLp8iIjNocyfJ`?M7hae^vP(atzz?}$U!%UwJ z(lQEFjnW>IR2p8E8M@=TJG S-@oRXEak|xz4{enSv>$660kM^ diff --git a/src/auth.ts b/src/auth.ts index 0e95ed00..2e7c6e8e 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -7,29 +7,28 @@ import * as io from '@actions/io'; export const M2_DIR = '.m2'; export const SETTINGS_FILE = 'settings.xml'; +export const DEFAULT_ID = 'github'; +export const DEFAULT_USERNAME = 'GITHUB_ACTOR'; +export const DEFAULT_PASSWORD = 'GITHUB_TOKEN'; + export async function configAuthentication( - id: string, - username: string, - password: string + id = DEFAULT_ID, + username = DEFAULT_USERNAME, + password = DEFAULT_PASSWORD ) { - if (id && username && password) { - console.log( - `creating ${SETTINGS_FILE} with server-id: ${id}, username: ${username}, and a password` - ); - // when an alternate m2 location is specified use only that location (no .m2 directory) - // otherwise use the home/.m2/ path - const directory: string = path.join( - core.getInput('settings-path') || os.homedir(), - core.getInput('settings-path') ? '' : M2_DIR - ); - await io.mkdirP(directory); - core.debug(`created directory ${directory}`); - await write(directory, generate(id, username, password)); - } else { - core.debug( - `no ${SETTINGS_FILE} without server-id: ${id}, username: ${username}, and a password` - ); - } + console.log( + `creating ${SETTINGS_FILE} with server-id: ${id};`, + `environment variables: username=\$${username} and password=\$${password}` + ); + // when an alternate m2 location is specified use only that location (no .m2 directory) + // otherwise use the home/.m2/ path + const directory: string = path.join( + core.getInput('settings-path') || os.homedir(), + core.getInput('settings-path') ? '' : M2_DIR + ); + await io.mkdirP(directory); + core.debug(`created directory ${directory}`); + await write(directory, generate(id, username, password)); } function escapeXML(value: string) { @@ -42,14 +41,18 @@ function escapeXML(value: string) { } // only exported for testing purposes -export function generate(id: string, username: string, password: string) { +export function generate( + id = DEFAULT_ID, + username = DEFAULT_USERNAME, + password = DEFAULT_PASSWORD +) { return ` ${escapeXML(id)} - ${escapeXML(username)} - ${escapeXML(password)} + \${env.${escapeXML(username)}} + \${env.${escapeXML(password)}} diff --git a/src/setup-java.ts b/src/setup-java.ts index 9300eef5..a50ff550 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -22,11 +22,7 @@ async function run() { const username = core.getInput('server-username', {required: false}); const password = core.getInput('server-password', {required: false}); - if (id && username && password) { - await auth.configAuthentication(id, username, password); - } else if (id || username || password) { - console.warn('All 3 server-(id, username, and password) are required.'); - } + await auth.configAuthentication(id, username, password); } catch (error) { core.setFailed(error.message); } From 0e5545ead5014c85875fdd4d6febc455d52030e8 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 19 Dec 2019 14:18:54 -0800 Subject: [PATCH 51/55] improve tests --- __tests__/auth.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index 5a31e277..13509682 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -92,7 +92,7 @@ describe('auth tests', () => { expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( - auth.generate('FOO') + auth.generate('FOO', auth.DEFAULT_USERNAME, auth.DEFAULT_PASSWORD) ); await auth.configAuthentication(undefined, 'BAR', undefined); @@ -100,7 +100,7 @@ describe('auth tests', () => { expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( - auth.generate(undefined, 'BAR', undefined) + auth.generate(auth.DEFAULT_ID, 'BAR', auth.DEFAULT_PASSWORD) ); await auth.configAuthentication(undefined, undefined, 'BAZ'); @@ -108,7 +108,7 @@ describe('auth tests', () => { expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( - auth.generate(undefined, undefined, 'BAZ') + auth.generate(auth.DEFAULT_ID, auth.DEFAULT_USERNAME, 'BAZ') ); await auth.configAuthentication(); @@ -116,7 +116,11 @@ describe('auth tests', () => { expect(fs.existsSync(m2Dir)).toBe(true); expect(fs.existsSync(settingsFile)).toBe(true); expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( - auth.generate(undefined, undefined, undefined) + auth.generate( + auth.DEFAULT_ID, + auth.DEFAULT_USERNAME, + auth.DEFAULT_PASSWORD + ) ); }, 100000); From 7e36086f368f03a37df27d38609ef98df42adb15 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 19 Dec 2019 14:20:17 -0800 Subject: [PATCH 52/55] Pass undefined when empty --- dist/index.js | Bin 158193 -> 158232 bytes src/setup-java.ts | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index be71c59d80e1f31b9dd23c4288afb719de1b5290..4fb758e4adbc0fd5449696ee0202fa80516448d4 100644 GIT binary patch delta 74 zcmex(nRCV!&W0_F1uuCOYHAcp^HNgNGV@YXrWd?q4B2Kb{G5r diff --git a/src/setup-java.ts b/src/setup-java.ts index a50ff550..7614f03d 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -18,9 +18,9 @@ async function run() { const matchersPath = path.join(__dirname, '..', '.github'); console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - const id = core.getInput('server-id', {required: false}); - const username = core.getInput('server-username', {required: false}); - const password = core.getInput('server-password', {required: false}); + const id = core.getInput('server-id', {required: false}) || undefined; + const username = core.getInput('server-username', {required: false}) || undefined; + const password = core.getInput('server-password', {required: false}) || undefined; await auth.configAuthentication(id, username, password); } catch (error) { From c05b45bb9156e7a0d3ed6a39e72b1debd3d0a780 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 19 Dec 2019 15:39:48 -0800 Subject: [PATCH 53/55] Update README with env sections --- README.md | 18 +++++++++--------- src/setup-java.ts | 6 ++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 977a4bb6..9a1915a1 100644 --- a/README.md +++ b/README.md @@ -69,28 +69,28 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - env: - GITHUB_TOKEN: ${{ github.token }} - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven run: mvn deploy + env: + GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password - name: Set up Apache Maven Central uses: actions/setup-java@v1 with: # running setup-java again overwrites the settings.xml java-version: 1.8 server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username below - server-password: MAVEN_CENTRAL_TOKEN # env variable for token below - env: - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - MAVEN_USERNAME: maven_username123 + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy - name: Publish to Apache Maven Central run: mvn deploy + env: + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_USERNAME: maven_username123 ``` ***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.*** @@ -142,14 +142,14 @@ jobs: java-version: 1.8 server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - env: - GITHUB_TOKEN: ${{ github.token }} - name: Build with Maven run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} ``` # License diff --git a/src/setup-java.ts b/src/setup-java.ts index 7614f03d..d0392175 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -19,8 +19,10 @@ async function run() { console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); const id = core.getInput('server-id', {required: false}) || undefined; - const username = core.getInput('server-username', {required: false}) || undefined; - const password = core.getInput('server-password', {required: false}) || undefined; + const username = + core.getInput('server-username', {required: false}) || undefined; + const password = + core.getInput('server-password', {required: false}) || undefined; await auth.configAuthentication(id, username, password); } catch (error) { From 2ccd1ad1251d6f44910aa33afb44208934d783bc Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Thu, 19 Dec 2019 15:44:10 -0800 Subject: [PATCH 54/55] Add examples of the settings.xml file generated --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a1915a1..944809ab 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,32 @@ jobs: - name: Publish to Apache Maven Central run: mvn deploy env: - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_USERNAME: maven_username123 + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} +``` + +The two `settings.xml` files created from the above example look like the following. + +`settings.xml` file created for the first deploy to GitHub Packages +```xml + + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + + +``` + +`settings.xml` file created for the second deploy to Apache Maven Central +```xml + + + maven + ${env.MAVEN_USERNAME} + ${env.MAVEN_CENTRAL_TOKEN} + + ``` ***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.*** From 9b11fe4b5ddd6e533908f148a4273e9685c007e1 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 20 Dec 2019 08:35:06 -0800 Subject: [PATCH 55/55] Add defaults descriptions to actions.yml --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index d310ebdb..6337613f 100644 --- a/action.yml +++ b/action.yml @@ -21,15 +21,15 @@ inputs: required: false server-id: description: 'ID of the distributionManagement repository in the pom.xml - file.' + file. Default is `github`' required: false server-username: description: 'Environment variable name for the username for authentication - to the Apache Maven repository.' + to the Apache Maven repository. Default is $GITHUB_ACTOR' required: false server-password: description: 'Environment variable name for password or token for - authentication to the Apache Maven repository.' + authentication to the Apache Maven repository. Default is $GITHUB_TOKEN' required: false settings-path: description: 'Path to where the settings.xml file will be written. Default is ~/.m2.'