Skip to content

Commit 66134d9

Browse files
committed
Merge remote-tracking branch 'origin/master' into flarco/master
Signed-off-by: Carlos A Becker <[email protected]>
2 parents 1315dab + 3c08cfd commit 66134d9

File tree

10 files changed

+21
-145
lines changed

10 files changed

+21
-145
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
with:
5858
distribution: ${{ matrix.distribution }}
5959
version: ${{ matrix.version }}
60-
args: release --skip-publish --rm-dist
60+
args: release --skip-publish --rm-dist --snapshot
6161
workdir: ./test
6262

6363
install-only:
@@ -138,7 +138,7 @@ jobs:
138138
uses: ./
139139
with:
140140
version: latest
141-
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist
141+
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist --snapshot
142142
workdir: ./test
143143
env:
144144
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
@@ -166,7 +166,7 @@ jobs:
166166
name: GoReleaser
167167
uses: ./
168168
with:
169-
args: release --skip-publish --rm-dist
169+
args: release --skip-publish --rm-dist --snapshot
170170
workdir: ./test
171171
-
172172
name: Upload assets
@@ -175,28 +175,6 @@ jobs:
175175
name: myapp
176176
path: ./test/dist/*
177177

178-
current-tag:
179-
runs-on: ubuntu-latest
180-
steps:
181-
-
182-
name: Checkout
183-
uses: actions/checkout@v3
184-
with:
185-
fetch-depth: 0
186-
-
187-
name: Set up Go
188-
uses: actions/setup-go@v3
189-
with:
190-
go-version: 1.18
191-
-
192-
name: GoReleaser
193-
uses: ./
194-
with:
195-
args: release --skip-publish --rm-dist
196-
workdir: ./test
197-
env:
198-
GORELEASER_CURRENT_TAG: v99.99.99
199-
200178
dist:
201179
runs-on: ubuntu-latest
202180
steps:
@@ -214,7 +192,7 @@ jobs:
214192
name: GoReleaser
215193
uses: ./
216194
with:
217-
args: release --config .goreleaser-dist.yml --skip-publish --rm-dist
195+
args: release --config .goreleaser-dist.yml --skip-publish --rm-dist --snapshot
218196
workdir: ./test
219197
-
220198
name: Check dist

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,15 @@ purpose. You can do that with the [actions/upload-artifact](https://github.com/a
138138
with:
139139
version: latest
140140
args: release --rm-dist
141+
workdir: myfolder
141142
env:
142143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143144
-
144145
name: Upload assets
145146
uses: actions/upload-artifact@v3
146147
with:
147148
name: myapp
148-
path: dist/*
149+
path: myfolder/dist/*
149150
```
150151

151152
### Install Only

__tests__/git.test.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@actions/http-client": "^2.0.1",
2727
"@actions/tool-cache": "^2.0.1",
2828
"js-yaml": "^4.1.0",
29-
"yargs": "^17.6.0"
29+
"yargs": "^17.6.2"
3030
},
3131
"devDependencies": {
3232
"@types/node": "^16.11.26",

src/git.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/goreleaser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export async function install(distribution: string, version: string): Promise<st
2828
core.info('Extracting GoReleaser');
2929
let extPath: string;
3030
if (context.osPlat == 'win32') {
31-
if(!downloadPath.endsWith('.zip')) {
32-
let newPath = downloadPath + '.zip';
31+
if (!downloadPath.endsWith('.zip')) {
32+
const newPath = downloadPath + '.zip';
3333
fs.renameSync(downloadPath, newPath);
3434
extPath = await tc.extractZip(newPath);
3535
} else {

src/main.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import yargs from 'yargs';
44
import * as context from './context';
5-
import * as git from './git';
65
import * as goreleaser from './goreleaser';
76
import * as core from '@actions/core';
87
import * as exec from '@actions/exec';
@@ -28,10 +27,6 @@ async function run(): Promise<void> {
2827
process.chdir(inputs.workdir);
2928
}
3029

31-
const commit = await git.getShortCommit();
32-
const tag = await git.getTag();
33-
const isTagDirty = await git.isTagDirty(tag);
34-
3530
let yamlfile: string | unknown;
3631
const argv = yargs.parse(inputs.args);
3732
if (argv.config) {
@@ -44,25 +39,7 @@ async function run(): Promise<void> {
4439
});
4540
}
4641

47-
let snapshot = '';
48-
if (inputs.args.split(' ').indexOf('release') > -1) {
49-
if (isTagDirty) {
50-
if (!inputs.args.includes('--snapshot') && !inputs.args.includes('--nightly')) {
51-
core.info(`No tag found for commit ${commit}. Snapshot forced`);
52-
snapshot = ' --snapshot';
53-
}
54-
} else {
55-
core.info(`${tag} tag found for commit ${commit}`);
56-
}
57-
}
58-
59-
await exec.exec(`${bin} ${inputs.args}${snapshot}`, undefined, {
60-
env: Object.assign({}, process.env, {
61-
GORELEASER_CURRENT_TAG: process.env.GORELEASER_CURRENT_TAG || tag || ''
62-
}) as {
63-
[key: string]: string;
64-
}
65-
});
42+
await exec.exec(`${bin} ${inputs.args}`);
6643

6744
if (typeof yamlfile === 'string') {
6845
const artifacts = await goreleaser.getArtifacts(await goreleaser.getDistPath(yamlfile));

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,10 +3558,10 @@ [email protected], yargs-parser@^20.2.2:
35583558
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
35593559
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
35603560

3561-
yargs-parser@^21.0.0:
3562-
version "21.0.1"
3563-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35"
3564-
integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==
3561+
yargs-parser@^21.1.1:
3562+
version "21.1.1"
3563+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
3564+
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
35653565

35663566
yargs@^16.2.0:
35673567
version "16.2.0"
@@ -3576,18 +3576,18 @@ yargs@^16.2.0:
35763576
y18n "^5.0.5"
35773577
yargs-parser "^20.2.2"
35783578

3579-
yargs@^17.6.0:
3580-
version "17.6.0"
3581-
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.0.tgz#e134900fc1f218bc230192bdec06a0a5f973e46c"
3582-
integrity sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==
3579+
yargs@^17.6.2:
3580+
version "17.6.2"
3581+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541"
3582+
integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==
35833583
dependencies:
35843584
cliui "^8.0.1"
35853585
escalade "^3.1.1"
35863586
get-caller-file "^2.0.5"
35873587
require-directory "^2.1.1"
35883588
string-width "^4.2.3"
35893589
y18n "^5.0.5"
3590-
yargs-parser "^21.0.0"
3590+
yargs-parser "^21.1.1"
35913591

35923592
35933593
version "3.1.1"

0 commit comments

Comments
 (0)