mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-30 00:08:28 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79d4afbba1 | ||
|
|
5df302e5e9 | ||
|
|
69b075db94 | ||
|
|
13b378d620 | ||
|
|
cb1d514d21 | ||
|
|
2efe451c4b | ||
|
|
fcc88bd028 | ||
|
|
25383ef1e0 | ||
|
|
bc087ef4b9 | ||
|
|
f9141d00ae | ||
|
|
1bdedc7bba |
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- windows-latest
|
- windows-latest
|
||||||
version:
|
version:
|
||||||
- latest
|
- latest
|
||||||
- '~> 0.166'
|
- '~> 0.182'
|
||||||
distribution:
|
distribution:
|
||||||
- goreleaser
|
- goreleaser
|
||||||
- goreleaser-pro
|
- goreleaser-pro
|
||||||
@@ -120,9 +120,9 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Import GPG key
|
name: Import GPG key
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v3
|
uses: crazy-max/ghaction-import-gpg@v4
|
||||||
with:
|
with:
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
||||||
-
|
-
|
||||||
name: Check
|
name: Check
|
||||||
|
|||||||
@@ -98,15 +98,16 @@ Or with a condition on GoReleaser step:
|
|||||||
|
|
||||||
### Signing
|
### Signing
|
||||||
|
|
||||||
If [signing is enabled](https://goreleaser.com/customization/#Signing) in your GoReleaser configuration, you can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one:
|
If [signing is enabled](https://goreleaser.com/customization/#Signing) in your GoReleaser configuration, you can use
|
||||||
|
the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Import GPG key
|
name: Import GPG key
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v3
|
uses: crazy-max/ghaction-import-gpg@v4
|
||||||
with:
|
with:
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ describe('git', () => {
|
|||||||
expect(tag).not.toEqual('');
|
expect(tag).not.toEqual('');
|
||||||
});
|
});
|
||||||
it('returns git tag through GITHUB_SHA', async () => {
|
it('returns git tag through GITHUB_SHA', async () => {
|
||||||
process.env.GITHUB_SHA = '6e37040623d14330555c7be1603a9182cf92d32a';
|
process.env.GITHUB_SHA = '6389ff5bd287fd6948a7ccda8af8da4f0bbc856a';
|
||||||
const tag: string = await git.getTag();
|
const tag: string = await git.getTag();
|
||||||
console.log(`tag: ${tag}`);
|
console.log(`tag: ${tag}`);
|
||||||
expect(tag).toEqual('v1');
|
expect(tag).toEqual('v2.2.1');
|
||||||
});
|
});
|
||||||
it('returns git tag through GITHUB_REF', async () => {
|
it('returns git tag through GITHUB_REF', async () => {
|
||||||
process.env.GITHUB_REF = 'refs/tags/v2.2.1';
|
process.env.GITHUB_REF = 'refs/tags/v2.2.1';
|
||||||
|
|||||||
+12
-12
@@ -6,29 +6,29 @@ describe('github', () => {
|
|||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).not.toEqual('');
|
expect(release?.tag_name).not.toEqual('');
|
||||||
});
|
});
|
||||||
it('returns v0.117.0 GoReleaser GitHub release', async () => {
|
it('returns v0.182.0 GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser', 'v0.117.0');
|
const release = await github.getRelease('goreleaser', 'v0.182.0');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.117.0');
|
expect(release?.tag_name).toEqual('v0.182.0');
|
||||||
});
|
});
|
||||||
it('returns v0.132.1 GoReleaser GitHub release', async () => {
|
it('returns v0.182.1 GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser', '~> 0.132');
|
const release = await github.getRelease('goreleaser', '~> 0.182');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.132.1');
|
expect(release?.tag_name).toEqual('v0.182.1');
|
||||||
});
|
});
|
||||||
it('returns latest GoReleaser Pro GitHub release', async () => {
|
it('returns latest GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', 'latest');
|
const release = await github.getRelease('goreleaser-pro', 'latest');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).not.toEqual('');
|
expect(release?.tag_name).not.toEqual('');
|
||||||
});
|
});
|
||||||
it('returns v0.166.0-pro GoReleaser Pro GitHub release', async () => {
|
it('returns v0.182.0-pro GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', 'v0.166.0-pro');
|
const release = await github.getRelease('goreleaser-pro', 'v0.182.0-pro');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.166.0-pro');
|
expect(release?.tag_name).toEqual('v0.182.0-pro');
|
||||||
});
|
});
|
||||||
it('returns v0.166.1-pro GoReleaser Pro GitHub release when using semver', async () => {
|
it('returns v0.182.1-pro GoReleaser Pro GitHub release when using semver', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', '~> 0.166');
|
const release = await github.getRelease('goreleaser-pro', '~> 0.182');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.166.1-pro');
|
expect(release?.tag_name).toEqual('v0.182.1-pro');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import fs = require('fs');
|
|||||||
import * as installer from '../src/installer';
|
import * as installer from '../src/installer';
|
||||||
|
|
||||||
describe('installer', () => {
|
describe('installer', () => {
|
||||||
it('acquires v0.117.0 version of GoReleaser', async () => {
|
it('acquires v0.182.0 version of GoReleaser', async () => {
|
||||||
const goreleaser = await installer.getGoReleaser('goreleaser', 'v0.117.0');
|
const goreleaser = await installer.getGoReleaser('goreleaser', 'v0.182.0');
|
||||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@ describe('installer', () => {
|
|||||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('acquires v0.166.0-pro version of GoReleaser Pro', async () => {
|
it('acquires v0.182.0-pro version of GoReleaser Pro', async () => {
|
||||||
const goreleaser = await installer.getGoReleaser('goreleaser-pro', 'v0.166.0-pro');
|
const goreleaser = await installer.getGoReleaser('goreleaser-pro', 'v0.182.0-pro');
|
||||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
|
|||||||
+220
-10
@@ -245,8 +245,30 @@ function getGoReleaser(distribution, version) {
|
|||||||
}
|
}
|
||||||
exports.getGoReleaser = getGoReleaser;
|
exports.getGoReleaser = getGoReleaser;
|
||||||
const getFilename = (distribution) => {
|
const getFilename = (distribution) => {
|
||||||
|
let arch;
|
||||||
|
switch (osArch) {
|
||||||
|
case 'x64': {
|
||||||
|
arch = 'x86_64';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'x32': {
|
||||||
|
arch = 'i386';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'arm': {
|
||||||
|
const arm_version = process.config.variables.arm_version;
|
||||||
|
arch = arm_version ? 'armv' + arm_version : 'arm';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
arch = osArch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (osPlat == 'darwin') {
|
||||||
|
arch = 'all';
|
||||||
|
}
|
||||||
const platform = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
const platform = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
||||||
const arch = osArch == 'x64' ? 'x86_64' : 'i386';
|
|
||||||
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||||
const suffix = pro.suffix(distribution);
|
const suffix = pro.suffix(distribution);
|
||||||
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);
|
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);
|
||||||
@@ -324,8 +346,8 @@ function run() {
|
|||||||
let snapshot = '';
|
let snapshot = '';
|
||||||
if (args.split(' ').indexOf('release') > -1) {
|
if (args.split(' ').indexOf('release') > -1) {
|
||||||
if (isTagDirty) {
|
if (isTagDirty) {
|
||||||
core.info(`No tag found for commit ${commit}. Snapshot forced`);
|
if (!args.includes('--snapshot') && !args.includes('--nightly')) {
|
||||||
if (!args.includes('--snapshot')) {
|
core.info(`No tag found for commit ${commit}. Snapshot forced`);
|
||||||
snapshot = ' --snapshot';
|
snapshot = ' --snapshot';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -500,12 +522,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
||||||
const command_1 = __nccwpck_require__(241);
|
const command_1 = __nccwpck_require__(241);
|
||||||
const file_command_1 = __nccwpck_require__(717);
|
const file_command_1 = __nccwpck_require__(717);
|
||||||
const utils_1 = __nccwpck_require__(278);
|
const utils_1 = __nccwpck_require__(278);
|
||||||
const os = __importStar(__nccwpck_require__(87));
|
const os = __importStar(__nccwpck_require__(87));
|
||||||
const path = __importStar(__nccwpck_require__(622));
|
const path = __importStar(__nccwpck_require__(622));
|
||||||
|
const oidc_utils_1 = __nccwpck_require__(41);
|
||||||
/**
|
/**
|
||||||
* The code to exit an action
|
* The code to exit an action
|
||||||
*/
|
*/
|
||||||
@@ -678,19 +701,30 @@ exports.debug = debug;
|
|||||||
/**
|
/**
|
||||||
* Adds an error issue
|
* Adds an error issue
|
||||||
* @param message error issue message. Errors will be converted to string via toString()
|
* @param message error issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function error(message) {
|
function error(message, properties = {}) {
|
||||||
command_1.issue('error', message instanceof Error ? message.toString() : message);
|
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.error = error;
|
exports.error = error;
|
||||||
/**
|
/**
|
||||||
* Adds an warning issue
|
* Adds a warning issue
|
||||||
* @param message warning issue message. Errors will be converted to string via toString()
|
* @param message warning issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
*/
|
*/
|
||||||
function warning(message) {
|
function warning(message, properties = {}) {
|
||||||
command_1.issue('warning', message instanceof Error ? message.toString() : message);
|
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
}
|
}
|
||||||
exports.warning = warning;
|
exports.warning = warning;
|
||||||
|
/**
|
||||||
|
* Adds a notice issue
|
||||||
|
* @param message notice issue message. Errors will be converted to string via toString()
|
||||||
|
* @param properties optional properties to add to the annotation.
|
||||||
|
*/
|
||||||
|
function notice(message, properties = {}) {
|
||||||
|
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
||||||
|
}
|
||||||
|
exports.notice = notice;
|
||||||
/**
|
/**
|
||||||
* Writes info to log with console.log.
|
* Writes info to log with console.log.
|
||||||
* @param message info message
|
* @param message info message
|
||||||
@@ -763,6 +797,12 @@ function getState(name) {
|
|||||||
return process.env[`STATE_${name}`] || '';
|
return process.env[`STATE_${name}`] || '';
|
||||||
}
|
}
|
||||||
exports.getState = getState;
|
exports.getState = getState;
|
||||||
|
function getIDToken(aud) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.getIDToken = getIDToken;
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -816,6 +856,90 @@ exports.issueCommand = issueCommand;
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 41:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
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) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.OidcClient = void 0;
|
||||||
|
const http_client_1 = __nccwpck_require__(925);
|
||||||
|
const auth_1 = __nccwpck_require__(702);
|
||||||
|
const core_1 = __nccwpck_require__(186);
|
||||||
|
class OidcClient {
|
||||||
|
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
||||||
|
const requestOptions = {
|
||||||
|
allowRetries: allowRetry,
|
||||||
|
maxRetries: maxRetry
|
||||||
|
};
|
||||||
|
return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
||||||
|
}
|
||||||
|
static getRequestToken() {
|
||||||
|
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
|
||||||
|
if (!token) {
|
||||||
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
static getIDTokenUrl() {
|
||||||
|
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
|
||||||
|
if (!runtimeUrl) {
|
||||||
|
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
|
||||||
|
}
|
||||||
|
return runtimeUrl;
|
||||||
|
}
|
||||||
|
static getCall(id_token_url) {
|
||||||
|
var _a;
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const httpclient = OidcClient.createHttpClient();
|
||||||
|
const res = yield httpclient
|
||||||
|
.getJson(id_token_url)
|
||||||
|
.catch(error => {
|
||||||
|
throw new Error(`Failed to get ID Token. \n
|
||||||
|
Error Code : ${error.statusCode}\n
|
||||||
|
Error Message: ${error.result.message}`);
|
||||||
|
});
|
||||||
|
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
||||||
|
if (!id_token) {
|
||||||
|
throw new Error('Response json body do not have ID Token field');
|
||||||
|
}
|
||||||
|
return id_token;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
static getIDToken(audience) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
// New ID Token is requested from action service
|
||||||
|
let id_token_url = OidcClient.getIDTokenUrl();
|
||||||
|
if (audience) {
|
||||||
|
const encodedAudience = encodeURIComponent(audience);
|
||||||
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
||||||
|
}
|
||||||
|
core_1.debug(`ID token url is ${id_token_url}`);
|
||||||
|
const id_token = yield OidcClient.getCall(id_token_url);
|
||||||
|
core_1.setSecret(id_token);
|
||||||
|
return id_token;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
throw new Error(`Error message: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.OidcClient = OidcClient;
|
||||||
|
//# sourceMappingURL=oidc-utils.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ 278:
|
/***/ 278:
|
||||||
/***/ ((__unused_webpack_module, exports) => {
|
/***/ ((__unused_webpack_module, exports) => {
|
||||||
|
|
||||||
@@ -824,7 +948,7 @@ exports.issueCommand = issueCommand;
|
|||||||
// We use any as a valid input type
|
// We use any as a valid input type
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.toCommandValue = void 0;
|
exports.toCommandProperties = exports.toCommandValue = void 0;
|
||||||
/**
|
/**
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
* @param input input to sanitize into a string
|
* @param input input to sanitize into a string
|
||||||
@@ -839,6 +963,26 @@ function toCommandValue(input) {
|
|||||||
return JSON.stringify(input);
|
return JSON.stringify(input);
|
||||||
}
|
}
|
||||||
exports.toCommandValue = toCommandValue;
|
exports.toCommandValue = toCommandValue;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param annotationProperties
|
||||||
|
* @returns The command properties to send with the actual annotation command
|
||||||
|
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
||||||
|
*/
|
||||||
|
function toCommandProperties(annotationProperties) {
|
||||||
|
if (!Object.keys(annotationProperties).length) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
title: annotationProperties.title,
|
||||||
|
file: annotationProperties.file,
|
||||||
|
line: annotationProperties.startLine,
|
||||||
|
endLine: annotationProperties.endLine,
|
||||||
|
col: annotationProperties.startColumn,
|
||||||
|
endColumn: annotationProperties.endColumn
|
||||||
|
};
|
||||||
|
}
|
||||||
|
exports.toCommandProperties = toCommandProperties;
|
||||||
//# sourceMappingURL=utils.js.map
|
//# sourceMappingURL=utils.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -1576,6 +1720,72 @@ class ExecState extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
//# sourceMappingURL=toolrunner.js.map
|
//# sourceMappingURL=toolrunner.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 702:
|
||||||
|
/***/ ((__unused_webpack_module, exports) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
class BasicCredentialHandler {
|
||||||
|
constructor(username, password) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] =
|
||||||
|
'Basic ' +
|
||||||
|
Buffer.from(this.username + ':' + this.password).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BasicCredentialHandler = BasicCredentialHandler;
|
||||||
|
class BearerCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Bearer ' + this.token;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BearerCredentialHandler = BearerCredentialHandler;
|
||||||
|
class PersonalAccessTokenCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] =
|
||||||
|
'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 925:
|
/***/ 925:
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"author": "CrazyMax",
|
"author": "CrazyMax",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.4.0",
|
"@actions/core": "^1.6.0",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/http-client": "^1.0.11",
|
"@actions/http-client": "^1.0.11",
|
||||||
"@actions/tool-cache": "^1.7.1"
|
"@actions/tool-cache": "^1.7.1"
|
||||||
|
|||||||
+23
-1
@@ -46,8 +46,30 @@ export async function getGoReleaser(distribution: string, version: string): Prom
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getFilename = (distribution: string): string => {
|
const getFilename = (distribution: string): string => {
|
||||||
|
let arch: string;
|
||||||
|
switch (osArch) {
|
||||||
|
case 'x64': {
|
||||||
|
arch = 'x86_64';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'x32': {
|
||||||
|
arch = 'i386';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'arm': {
|
||||||
|
const arm_version = (process.config.variables as any).arm_version;
|
||||||
|
arch = arm_version ? 'armv' + arm_version : 'arm';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
arch = osArch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (osPlat == 'darwin') {
|
||||||
|
arch = 'all';
|
||||||
|
}
|
||||||
const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
||||||
const arch: string = osArch == 'x64' ? 'x86_64' : 'i386';
|
|
||||||
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||||
const suffix: string = pro.suffix(distribution);
|
const suffix: string = pro.suffix(distribution);
|
||||||
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);
|
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);
|
||||||
|
|||||||
+2
-2
@@ -36,8 +36,8 @@ async function run(): Promise<void> {
|
|||||||
let snapshot = '';
|
let snapshot = '';
|
||||||
if (args.split(' ').indexOf('release') > -1) {
|
if (args.split(' ').indexOf('release') > -1) {
|
||||||
if (isTagDirty) {
|
if (isTagDirty) {
|
||||||
core.info(`No tag found for commit ${commit}. Snapshot forced`);
|
if (!args.includes('--snapshot') && !args.includes('--nightly')) {
|
||||||
if (!args.includes('--snapshot')) {
|
core.info(`No tag found for commit ${commit}. Snapshot forced`);
|
||||||
snapshot = ' --snapshot';
|
snapshot = ' --snapshot';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@actions/core@^1.2.6", "@actions/core@^1.4.0":
|
"@actions/core@^1.2.6", "@actions/core@^1.6.0":
|
||||||
version "1.4.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.4.0.tgz#cf2e6ee317e314b03886adfeb20e448d50d6e524"
|
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.6.0.tgz#0568e47039bfb6a9170393a73f3b7eb3b22462cb"
|
||||||
integrity sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==
|
integrity sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==
|
||||||
|
dependencies:
|
||||||
|
"@actions/http-client" "^1.0.11"
|
||||||
|
|
||||||
"@actions/exec@^1.0.0", "@actions/exec@^1.1.0":
|
"@actions/exec@^1.0.0", "@actions/exec@^1.1.0":
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
@@ -697,9 +699,9 @@ ansi-escapes@^4.2.1:
|
|||||||
type-fest "^0.21.3"
|
type-fest "^0.21.3"
|
||||||
|
|
||||||
ansi-regex@^5.0.0:
|
ansi-regex@^5.0.0:
|
||||||
version "5.0.0"
|
version "5.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||||
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
|
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||||
|
|
||||||
ansi-styles@^3.2.1:
|
ansi-styles@^3.2.1:
|
||||||
version "3.2.1"
|
version "3.2.1"
|
||||||
@@ -3261,9 +3263,9 @@ tmp@^0.2.1:
|
|||||||
rimraf "^3.0.0"
|
rimraf "^3.0.0"
|
||||||
|
|
||||||
tmpl@1.0.x:
|
tmpl@1.0.x:
|
||||||
version "1.0.4"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
|
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
|
||||||
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
|
integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==
|
||||||
|
|
||||||
to-fast-properties@^2.0.0:
|
to-fast-properties@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user