Allow to run GoReleaser from a subdirectory (#45)
This commit is contained in:
parent
6ec955d9f0
commit
16077aaddc
11
README.md
11
README.md
|
@ -53,11 +53,12 @@ jobs:
|
|||
|
||||
Following inputs can be used as `step.with` keys
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|---------------|---------|-----------|------------------------------------------|
|
||||
| `version` | String | `latest` | GoReleaser version. Example: `v0.117.0` |
|
||||
| `args` | String | | Arguments to pass to GoReleaser |
|
||||
| `key` | String | | Private key to import |
|
||||
| Name | Type | Default | Description |
|
||||
|---------------|---------|-----------|-------------------------------------------|
|
||||
| `version` | String | `latest` | GoReleaser version. Example: `v0.117.0` |
|
||||
| `args` | String | | Arguments to pass to GoReleaser |
|
||||
| `key` | String | | Private key to import |
|
||||
| `workdir` | String | `.` | Working directory (below repository root) |
|
||||
|
||||
### Signing
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@ inputs:
|
|||
description: 'Arguments to pass to GoReleaser'
|
||||
key:
|
||||
description: 'Private key to import'
|
||||
workdir:
|
||||
description: 'Working directory (below repository root)'
|
||||
default: '.'
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
|
|
|
@ -26,7 +26,12 @@ function run(silent) {
|
|||
const version = core.getInput('version') || 'latest';
|
||||
const args = core.getInput('args');
|
||||
const key = core.getInput('key');
|
||||
const workdir = core.getInput('workdir') || '.';
|
||||
const goreleaser = yield installer.getGoReleaser(version);
|
||||
if (workdir && workdir !== '.') {
|
||||
console.log(`📂 Using ${workdir} as working directory...`);
|
||||
process.chdir(workdir);
|
||||
}
|
||||
let snapshot = '';
|
||||
if (!process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
|
||||
console.log(`⚠️ No tag found. Snapshot forced`);
|
||||
|
|
|
@ -8,8 +8,14 @@ export async function run(silent?: boolean) {
|
|||
const version = core.getInput('version') || 'latest';
|
||||
const args = core.getInput('args');
|
||||
const key = core.getInput('key');
|
||||
const workdir = core.getInput('workdir') || '.';
|
||||
const goreleaser = await installer.getGoReleaser(version);
|
||||
|
||||
if (workdir && workdir !== '.') {
|
||||
console.log(`📂 Using ${workdir} as working directory...`)
|
||||
process.chdir(workdir);
|
||||
}
|
||||
|
||||
let snapshot = '';
|
||||
if (!process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
|
||||
console.log(`⚠️ No tag found. Snapshot forced`);
|
||||
|
|
Loading…
Reference in New Issue