mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-28 23:38:29 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e435ccd777 | ||
|
|
2ff5850a92 | ||
|
|
9a6cd01b33 | ||
|
|
a386515f0c | ||
|
|
ca48102d58 | ||
|
|
0931acf1f7 | ||
|
|
90c43f2c19 | ||
|
|
9c156ee8a1 | ||
|
|
73c477b761 | ||
|
|
19c00a97d6 | ||
|
|
90a3faa9d0 | ||
|
|
0262998728 | ||
|
|
450d3a4bd2 | ||
|
|
25b92abef8 | ||
|
|
bc0ac76346 | ||
|
|
842e7ccd3e | ||
|
|
d28c98212f | ||
|
|
9ed2f89a66 | ||
|
|
cf63508052 | ||
|
|
f7623f3e71 | ||
|
|
006a7a4111 | ||
|
|
e4066e695c | ||
|
|
22f558e822 | ||
|
|
6e33108d10 | ||
|
|
7ca645047c | ||
|
|
d33b6f6aea | ||
|
|
85d0b9d4cd | ||
|
|
286f3b13b1 | ||
|
|
beac410314 | ||
|
|
18bbabc70c | ||
|
|
5742e2a039 | ||
|
|
70ccc5d2da | ||
|
|
d55bec790d | ||
|
|
f1dbd532c3 | ||
|
|
2953d07480 | ||
|
|
62d4b8ad34 | ||
|
|
f09f1a7bee | ||
|
|
9937f9bad9 | ||
|
|
b7f6f16d51 | ||
|
|
c21f56a7bc | ||
|
|
696b757ee8 | ||
|
|
94b86e1b02 | ||
|
|
d50b0c42ee | ||
|
|
14707cd26f | ||
|
|
e0e636a951 | ||
|
|
e03329bcfe | ||
|
|
72088715cb | ||
|
|
44dd9927f4 | ||
|
|
9d3b418705 | ||
|
|
7d864bed1f | ||
|
|
7ec5c2b0c6 | ||
|
|
3529a650d2 | ||
|
|
d2f6e33a35 | ||
|
|
5fdedb94ab | ||
|
|
81d9ad7185 | ||
|
|
a10d0e32dc | ||
|
|
3fa32b8bb5 | ||
|
|
c7c9447c79 | ||
|
|
920a7cbd0a | ||
|
|
336e29918d | ||
|
|
37247345b4 | ||
|
|
f424e9de13 | ||
|
|
7e0ddfe79f | ||
|
|
cffc4af7bf | ||
|
|
08e23ccf3b | ||
|
|
d756366df6 | ||
|
|
0c7e252c3a | ||
|
|
347176ca37 | ||
|
|
2fce7c4986 | ||
|
|
1d44853e58 | ||
|
|
45b37916b0 | ||
|
|
97503b1435 | ||
|
|
eeac89f426 | ||
|
|
8f389eacd3 | ||
|
|
f82d6c1c34 | ||
|
|
9754a253a8 | ||
|
|
b1a238106b | ||
|
|
b1ffc5d990 | ||
|
|
256e4b8b28 | ||
|
|
a7c543ca7a | ||
|
|
13f1e21a50 | ||
|
|
8f67e590f2 | ||
|
|
78df308971 | ||
|
|
66134d94a7 | ||
|
|
3c08cfd84b | ||
|
|
5dc579bb76 | ||
|
|
3b7d1ba946 | ||
|
|
23e0ed5919 | ||
|
|
1315dabfd1 | ||
|
|
b60ea886c6 | ||
|
|
4d25ab4fd4 | ||
|
|
b508e2e3ef | ||
|
|
0ca84fc3f8 | ||
|
|
685a9915ae | ||
|
|
ff11ca24a9 | ||
|
|
ef54bd4cd6 | ||
|
|
aab65f3702 | ||
|
|
7bb9301b2c | ||
|
|
50f10b3c28 | ||
|
|
188063da7e | ||
|
|
7e270cc4b5 | ||
|
|
68acf3b1ad | ||
|
|
46da1137fb | ||
|
|
223909a9be | ||
|
|
c56d8dfa43 | ||
|
|
d1c2f8317e | ||
|
|
5c65fd87a6 | ||
|
|
46cd12b0b3 | ||
|
|
822d1bf019 | ||
|
|
c25888f15f | ||
|
|
ec57748af4 | ||
|
|
fb388c065d | ||
|
|
b41b4bdb3b | ||
|
|
1fe3c2886a | ||
|
|
87a2efefe1 | ||
|
|
7e40e0905d | ||
|
|
c6e13393a3 | ||
|
|
0110a4acb7 | ||
|
|
374cbfc688 | ||
|
|
221e84ac6a | ||
|
|
b953231f81 | ||
|
|
c127c9be61 | ||
|
|
affd781166 | ||
|
|
39419c3fac | ||
|
|
a80c8fd82d | ||
|
|
79d4afbba1 | ||
|
|
5df302e5e9 | ||
|
|
69b075db94 | ||
|
|
13b378d620 | ||
|
|
cb1d514d21 | ||
|
|
2efe451c4b | ||
|
|
fcc88bd028 | ||
|
|
25383ef1e0 | ||
|
|
bc087ef4b9 | ||
|
|
f9141d00ae | ||
|
|
1bdedc7bba | ||
|
|
5a54d7e660 | ||
|
|
a59bcd6856 | ||
|
|
b59bff5dc3 | ||
|
|
b2263bd81e | ||
|
|
76bde1890b | ||
|
|
194deb5974 | ||
|
|
ac067437f5 | ||
|
|
bbb1d19f5b | ||
|
|
d0c4a003d3 | ||
|
|
c2b33cd784 | ||
|
|
35d40269d0 | ||
|
|
be642f174c | ||
|
|
d401a5332a | ||
|
|
70eb4e573c | ||
|
|
a3b2f49e7c | ||
|
|
8571fa911c | ||
|
|
a604a9b2f7 | ||
|
|
239f064349 | ||
|
|
ab4f17620b | ||
|
|
15c488ce8f | ||
|
|
f08023819a | ||
|
|
4921ce3062 | ||
|
|
6b584eeb7a | ||
|
|
5e15885530 | ||
|
|
748d6973af | ||
|
|
0e0aa65c79 | ||
|
|
b458824747 | ||
|
|
d8a076a057 | ||
|
|
e1c89b9548 | ||
|
|
e64074c2ea | ||
|
|
edea00d0c6 | ||
|
|
56f5b77f7f | ||
|
|
c1dfc73b78 | ||
|
|
97d4c6b042 | ||
|
|
0e7950faac | ||
|
|
09ce14113d | ||
|
|
50de962f84 | ||
|
|
a61bc075fd | ||
|
|
d19982d4d2 | ||
|
|
499c61b7c5 | ||
|
|
ddc7bc8b43 | ||
|
|
9c48726d5e | ||
|
|
d0f90f55ae | ||
|
|
f2a4c95ec7 | ||
|
|
3d57a20621 | ||
|
|
3f5ecc4e17 | ||
|
|
70364181ef | ||
|
|
7007251a74 | ||
|
|
c5a3850c06 | ||
|
|
4441f834e5 | ||
|
|
e8c391b2a4 | ||
|
|
608bdefa0e | ||
|
|
6389ff5bd2 | ||
|
|
9593cd0a20 | ||
|
|
d93a2cdf8c | ||
|
|
3c2d9ae011 | ||
|
|
2fc4e3ac51 | ||
|
|
097bb3c0c5 | ||
|
|
d72a78ab06 | ||
|
|
90d3577f6e | ||
|
|
309312125e | ||
|
|
46aa4473cd | ||
|
|
5c7fddc6a0 | ||
|
|
d223864797 | ||
|
|
8be826a5af | ||
|
|
3a20bfb75b | ||
|
|
bc5f714900 | ||
|
|
28f040b0c9 | ||
|
|
3784b5a5df | ||
|
|
8708f57399 | ||
|
|
044b9d4d64 | ||
|
|
0d32e80d56 | ||
|
|
eed3dc901e | ||
|
|
44b6852272 | ||
|
|
aff4fc5a2c | ||
|
|
c30b077d74 | ||
|
|
3b7a8e97ab | ||
|
|
10511362f8 | ||
|
|
62b67a060c | ||
|
|
de0cc32957 | ||
|
|
07505093f2 | ||
|
|
de0090dcf9 | ||
|
|
56a17acc58 | ||
|
|
e9d8a486b9 | ||
|
|
1de7ab1241 | ||
|
|
da499dc8c4 | ||
|
|
bf5c0312ba | ||
|
|
30f55a5465 | ||
|
|
46fecbc374 | ||
|
|
e2e0026788 | ||
|
|
c782db219c | ||
|
|
e4f3e46c3a | ||
|
|
354ab336f2 | ||
|
|
aa45e0b3de | ||
|
|
3fc0ad887b | ||
|
|
5ea6f8cff6 | ||
|
|
408809cf2e | ||
|
|
5df9eaf51a | ||
|
|
2f7115b6eb | ||
|
|
6e289c036a | ||
|
|
8d2d6e23ba | ||
|
|
e3e8938134 | ||
|
|
aa1fbb5b7f | ||
|
|
0122c3b611 | ||
|
|
32c621e48f | ||
|
|
d922612e4f | ||
|
|
4f52b7bd4b | ||
|
|
5067175657 | ||
|
|
1723202839 | ||
|
|
277675f877 | ||
|
|
a9021ad9f8 | ||
|
|
551f7d8a6c | ||
|
|
849d1c01b1 | ||
|
|
ac187d128a | ||
|
|
108bc4da5a | ||
|
|
92b29cc8ff | ||
|
|
87487e9bbd | ||
|
|
99636ee53c | ||
|
|
3140f0a474 | ||
|
|
83d17e5b70 | ||
|
|
3fa258510f | ||
|
|
17a723793e | ||
|
|
0c93efcb3b | ||
|
|
bfee8df61e | ||
|
|
65ffe9d1d5 | ||
|
|
145323343f | ||
|
|
c2638bf40c | ||
|
|
f3c3945401 | ||
|
|
b965206285 | ||
|
|
5ee2a593ae |
@@ -0,0 +1,12 @@
|
||||
/coverage
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
@@ -0,0 +1,3 @@
|
||||
/dist/**
|
||||
/coverage/**
|
||||
/node_modules/**
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jest",
|
||||
"prettier"
|
||||
]
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/dist/** linguist-generated=true
|
||||
/lib/** linguist-generated=true
|
||||
|
||||
+3
-2
@@ -1,2 +1,3 @@
|
||||
github: crazy-max
|
||||
custom: https://www.paypal.me/crazyws
|
||||
github: [crazy-max, caarlos0]
|
||||
open_collective: goreleaser
|
||||
custom: ["https://goreleaser.com/pro"]
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "06:00"
|
||||
timezone: "Europe/Paris"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "06:00"
|
||||
timezone: "Europe/Paris"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
labels:
|
||||
- "dependencies"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,51 +0,0 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- feature/*
|
||||
- releases/*
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- feature/*
|
||||
- releases/*
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-latest
|
||||
version:
|
||||
- latest
|
||||
- v0.117.0
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.13
|
||||
-
|
||||
name: Check
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
args: check --debug
|
||||
-
|
||||
name: GoReleaser
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
args: release --skip-publish --rm-dist
|
||||
@@ -0,0 +1,246 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
version:
|
||||
- latest
|
||||
- '~> 2.6'
|
||||
- '~> 1.26'
|
||||
distribution:
|
||||
- goreleaser
|
||||
- goreleaser-pro
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: Check
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
args: check --verbose
|
||||
workdir: ./test
|
||||
-
|
||||
name: GoReleaser
|
||||
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
|
||||
uses: ./
|
||||
env:
|
||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||
with:
|
||||
distribution: ${{ matrix.distribution }}
|
||||
version: ${{ matrix.version }}
|
||||
args: release --skip=publish --clean --snapshot
|
||||
workdir: ./test
|
||||
|
||||
install-only:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- latest
|
||||
- '~> 2.6'
|
||||
- '~> 1.26'
|
||||
distribution:
|
||||
- goreleaser
|
||||
- goreleaser-pro
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: GoReleaser
|
||||
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
|
||||
uses: ./
|
||||
with:
|
||||
distribution: ${{ matrix.distribution }}
|
||||
version: ${{ matrix.version }}
|
||||
install-only: true
|
||||
-
|
||||
name: Check
|
||||
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
|
||||
run: |
|
||||
goreleaser check --verbose
|
||||
|
||||
signing:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.event_name != 'pull_request'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: Import GPG key
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
||||
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
||||
-
|
||||
name: Check
|
||||
uses: ./
|
||||
with:
|
||||
version: latest
|
||||
args: -f .goreleaser-signing.yml check --verbose
|
||||
workdir: ./test
|
||||
env:
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
-
|
||||
name: GoReleaser
|
||||
uses: ./
|
||||
with:
|
||||
version: latest
|
||||
args: -f .goreleaser-signing.yml release --skip=publish --clean --snapshot
|
||||
workdir: ./test
|
||||
env:
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
|
||||
upload-artifact:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: Check
|
||||
uses: ./
|
||||
with:
|
||||
args: check --verbose
|
||||
workdir: ./test
|
||||
-
|
||||
name: GoReleaser
|
||||
uses: ./
|
||||
with:
|
||||
args: release --skip=publish --clean --snapshot
|
||||
workdir: ./test
|
||||
-
|
||||
name: Upload assets
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: myapp
|
||||
path: ./test/dist/*
|
||||
|
||||
dist:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: GoReleaser
|
||||
uses: ./
|
||||
with:
|
||||
args: release --config .goreleaser-dist.yml --skip=publish --clean --snapshot
|
||||
workdir: ./test
|
||||
-
|
||||
name: Check dist
|
||||
run: |
|
||||
tree -nh ./test/_output
|
||||
|
||||
nightly:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
distribution:
|
||||
- goreleaser-pro
|
||||
- goreleaser
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.18
|
||||
-
|
||||
name: GoReleaser
|
||||
uses: ./
|
||||
with:
|
||||
install-only: true
|
||||
distribution: ${{ matrix.distribution }}
|
||||
version: nightly
|
||||
-
|
||||
name: Check
|
||||
run: |
|
||||
goreleaser check -f ./test/.goreleaser.yml
|
||||
goreleaser --version
|
||||
goreleaser --version | grep nightly
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint.yml'
|
||||
- 'src/*'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
# https://github.com/actions/setup-node
|
||||
name: Set up Node
|
||||
uses: actions/setup-node@v1
|
||||
-
|
||||
name: Setup TS
|
||||
run: npm install tslint typescript -g
|
||||
-
|
||||
name: Lint check
|
||||
run: tslint './src/*.ts'
|
||||
+23
-32
@@ -1,46 +1,37 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- feature/*
|
||||
- releases/*
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- feature/*
|
||||
- releases/*
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
-
|
||||
name: Install
|
||||
run: npm install
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Test
|
||||
run: npm run test
|
||||
-
|
||||
# https://github.com/codecov/codecov-action
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
if: success()
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage/clover.xml
|
||||
source: .
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
files: ./coverage/clover.xml
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
name: validate
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- prepare
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
+14
-57
@@ -1,12 +1,5 @@
|
||||
/.dev
|
||||
node_modules/
|
||||
lib
|
||||
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@@ -24,34 +18,14 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
@@ -61,36 +35,19 @@ typings/
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.test
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/
|
||||
+541
File diff suppressed because one or more lines are too long
+13
@@ -0,0 +1,13 @@
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
@@ -1,72 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## 1.5.0 (2020/05/07)
|
||||
|
||||
* Use native GitHub Action tools to download assets and use GitHub API
|
||||
* Fix unexpected output when tag not found
|
||||
* Use GitHub Action exec
|
||||
* Cleanup local paths from extra fields
|
||||
* Add notes about limitation with GITHUB_TOKEN (#58)
|
||||
* Add Codecov
|
||||
|
||||
## 1.4.0 (2020/04/09)
|
||||
|
||||
* Use ncc and clean workflows
|
||||
* Update deps
|
||||
|
||||
## 1.3.1 (2020/02/14)
|
||||
|
||||
* Don't fail on `getTag` (#98)
|
||||
|
||||
## 1.3.0 (2020/02/11)
|
||||
|
||||
* Improve git tag detection (#77)
|
||||
* Only handle snapshot flag for release cmd (#94)
|
||||
* Use `core.info` instead of `console.log`
|
||||
* Update deps
|
||||
* Update gitattributes
|
||||
|
||||
## 1.2.1 (2020/01/20)
|
||||
|
||||
* Update deps
|
||||
|
||||
## 1.2.0 (2019/12/24)
|
||||
|
||||
* Update deps
|
||||
|
||||
## 1.1.0 (2019/12/02)
|
||||
|
||||
* Add input to run GoReleaser from a subdirectory (#45)
|
||||
|
||||
## 1.0.2 (2019/11/14)
|
||||
|
||||
* Fix tsc gen
|
||||
|
||||
## 1.0.1 (2019/11/14)
|
||||
|
||||
* Update deps
|
||||
|
||||
## 1.0.0 (2019/10/04)
|
||||
|
||||
* Stable release
|
||||
* Update deps
|
||||
|
||||
## 0.4.0 (2019/09/28)
|
||||
|
||||
* Move repository to GoReleaser org (#3)
|
||||
|
||||
## 0.3.0 (2019/09/26)
|
||||
|
||||
* Artifact signing (#2)
|
||||
|
||||
## 0.2.1 (2019/09/22)
|
||||
|
||||
* Typo
|
||||
|
||||
## 0.2.0 (2019/09/20)
|
||||
|
||||
* Snapshot forced if no tag found
|
||||
|
||||
## 0.1.0 (2019/09/20)
|
||||
|
||||
* Initial version
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-2020 CrazyMax
|
||||
Copyright (c) 2019-2022 CrazyMax
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -5,18 +5,39 @@
|
||||
<p align="center">
|
||||
<a href="https://github.com/goreleaser/goreleaser-action/releases/latest"><img alt="GitHub release" src="https://img.shields.io/github/release/goreleaser/goreleaser-action.svg?logo=github&style=flat-square"></a>
|
||||
<a href="https://github.com/marketplace/actions/goreleaser-action"><img alt="GitHub marketplace" src="https://img.shields.io/badge/marketplace-goreleaser--action-blue?logo=github&style=flat-square"></a>
|
||||
<a href="https://github.com/goreleaser/goreleaser-action/actions?workflow=test"><img alt="Test workflow" src="https://img.shields.io/github/workflow/status/goreleaser/goreleaser-action/test?label=test&logo=github&style=flat-square"></a>
|
||||
<a href="https://github.com/goreleaser/goreleaser-action/actions?workflow=test"><img alt="Test workflow" src="https://img.shields.io/github/actions/workflow/status/goreleaser/goreleaser-action/test.yml?label=test&branch=master&logo=github&style=flat-square"></a>
|
||||
<a href="https://codecov.io/gh/goreleaser/goreleaser-action"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/goreleaser/goreleaser-action?logo=codecov&style=flat-square"></a>
|
||||
<a href="https://github.com/sponsors/crazy-max"><img src="https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square" alt="Become a sponsor"></a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
---
|
||||
___
|
||||
|
||||

|
||||
|
||||
* [Usage](#usage)
|
||||
* [Workflow](#workflow)
|
||||
* [Run on new tag](#run-on-new-tag)
|
||||
* [Signing](#signing)
|
||||
* [Upload artifacts](#upload-artifacts)
|
||||
* [Install Only](#install-only)
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [outputs](#outputs)
|
||||
* [environment variables](#environment-variables)
|
||||
* [Limitation](#limitation)
|
||||
* [Development](#development)
|
||||
* [License](#license)
|
||||
|
||||
## Usage
|
||||
|
||||
GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for
|
||||
more information about how to customize what GoReleaser does.
|
||||
|
||||
[goreleaser]: https://goreleaser.com/
|
||||
[gdocs]: https://goreleaser.com/customization
|
||||
|
||||
### Workflow
|
||||
|
||||
```yaml
|
||||
name: goreleaser
|
||||
|
||||
@@ -24,33 +45,39 @@ on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.13
|
||||
uses: actions/setup-go@v5
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||
distribution: goreleaser
|
||||
# 'latest', 'nightly', or a semver
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
|
||||
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||
```
|
||||
|
||||
> **IMPORTANT**: note the `Unshallow` step. It is required for the changelog to work correctly.
|
||||
> **IMPORTANT**: note the `fetch-depth: 0` input in `Checkout` step. It is required for the changelog to work correctly.
|
||||
|
||||
### Run on new tag
|
||||
|
||||
If you want to run GoReleaser only on new tag, you can use this event:
|
||||
|
||||
@@ -66,72 +93,156 @@ Or with a condition on GoReleaser step:
|
||||
```yaml
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
> For detailed instructions please follow GitHub Actions [workflow syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions#About-yaml-syntax-for-workflows).
|
||||
|
||||
### 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:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Import GPG key
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.PASSPHRASE }}
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
```
|
||||
|
||||
And reference the fingerprint in your signing configuration using the `GPG_FINGERPRINT` environment variable:
|
||||
|
||||
```yaml
|
||||
signs:
|
||||
- artifacts: checksum
|
||||
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||
```
|
||||
|
||||
### Upload artifacts
|
||||
|
||||
For some events like pull request or schedule you might want to store the artifacts somewhere for testing
|
||||
purposes. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
workdir: myfolder
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Upload assets
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: myapp
|
||||
path: myfolder/dist/*
|
||||
```
|
||||
|
||||
### Install Only
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
-
|
||||
name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
install-only: true
|
||||
-
|
||||
name: Show GoReleaser version
|
||||
run: goreleaser -v
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
||||
### inputs
|
||||
|
||||
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 |
|
||||
| `workdir` | String | `.` | Working directory (below repository root) |
|
||||
| Name | Type | Default | Description |
|
||||
|------------------|---------|--------------|------------------------------------------------------------------|
|
||||
| `distribution` | String | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` |
|
||||
| `version`**¹** | String | `~> v2` | GoReleaser version |
|
||||
| `args` | String | | Arguments to pass to GoReleaser |
|
||||
| `workdir` | String | `.` | Working directory (below repository root) |
|
||||
| `install-only` | Bool | `false` | Just install GoReleaser |
|
||||
|
||||
> **¹** Can be a fixed version like `v0.117.0` or a max satisfying semver one like `~> 0.132`. In this case this will return `v0.132.1`.
|
||||
|
||||
### outputs
|
||||
|
||||
Following outputs are available
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|------|------------------------|
|
||||
| `artifacts` | JSON | Build result artifacts |
|
||||
| `metadata` | JSON | Build result metadata |
|
||||
|
||||
### environment variables
|
||||
|
||||
Following environment variables can be used as `step.env` keys
|
||||
|
||||
| Name | Description |
|
||||
|----------------|---------------------------------------|
|
||||
| `GITHUB_TOKEN` | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) as provided by `secrets` |
|
||||
| Name | Description |
|
||||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `GITHUB_TOKEN` | [GITHUB_TOKEN](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) as provided by `secrets` and requires `contents:write` |
|
||||
| `GORELEASER_KEY` | Your [GoReleaser Pro](https://goreleaser.com/pro) License Key, in case you are using the `goreleaser-pro` distribution |
|
||||
|
||||
## Limitation
|
||||
|
||||
`GITHUB_TOKEN` permissions [are limited to the repository](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret)
|
||||
that contains your workflow.
|
||||
that contains your workflow.
|
||||
|
||||
If you need to push the homebrew tap to another repository, you must therefore create a custom [Personal Access Token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
|
||||
with `repo` permissions and [add it as a secret in the repository](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets). If you create a
|
||||
with `repo` permissions and [add it as a secret in the repository](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets). If you create a
|
||||
secret named `GH_PAT`, the step will look like this:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
```
|
||||
|
||||
## Signing
|
||||
## Migrating from v3
|
||||
|
||||
If signing is enabled in your GoReleaser configuration, populate the `key` input with your private key
|
||||
and reference the key in your signing configuration, e.g.
|
||||
If you need the auto-snapshot feature, take a look at [this example repository](https://github.com/caarlos0/goreleaser-action-v4-auto-snapshot-example): it's a minimal working example with all you need.
|
||||
|
||||
## Development
|
||||
|
||||
```yaml
|
||||
signs:
|
||||
- artifacts: checksum
|
||||
args: ["--batch", "-u", "<key id, fingerprint, email, ...>", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||
```
|
||||
# format code and build javascript artifacts
|
||||
docker buildx bake pre-checkin
|
||||
|
||||
This feature is currently only compatible when using the default `gpg` command and a private key without a passphrase.
|
||||
# validate all code has correctly formatted and built
|
||||
docker buildx bake validate
|
||||
|
||||
# run tests
|
||||
docker buildx bake test
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import * as git from '../src/git';
|
||||
|
||||
describe('git', () => {
|
||||
it('returns git tag', async () => {
|
||||
const tag: string = await git.getTag();
|
||||
console.log(tag);
|
||||
expect(tag).not.toEqual('');
|
||||
});
|
||||
it('checks if tag is dirty', async () => {
|
||||
expect(await git.isTagDirty('v1.3.1')).toBe(true);
|
||||
});
|
||||
it('returns short commit', async () => {
|
||||
const commit: string = await git.getShortCommit();
|
||||
console.log(commit);
|
||||
expect(commit).not.toEqual('');
|
||||
});
|
||||
});
|
||||
@@ -1,16 +1,106 @@
|
||||
import {describe, expect, it} from '@jest/globals';
|
||||
import * as github from '../src/github';
|
||||
|
||||
describe('github', () => {
|
||||
describe('getRelease', () => {
|
||||
it('returns latest GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('latest');
|
||||
console.log(release);
|
||||
const release = await github.getRelease('goreleaser', 'latest');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
it('returns v0.117.0 GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('v0.117.0');
|
||||
console.log(release);
|
||||
|
||||
it('returns v0.182.0 GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser', 'v0.182.0');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v0.117.0');
|
||||
expect(release?.tag_name).toEqual('v0.182.0');
|
||||
});
|
||||
|
||||
it('returns v0.182.1 GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser', '~> 0.182');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v0.182.1');
|
||||
});
|
||||
|
||||
it('unknown GoReleaser release', async () => {
|
||||
await expect(github.getRelease('goreleaser', 'foo')).rejects.toThrow(
|
||||
new Error('Cannot find GoReleaser release foo in https://goreleaser.com/static/releases.json')
|
||||
);
|
||||
});
|
||||
|
||||
it('returns latest GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', 'latest');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns latest v1 GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', '~> v1');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns latest v1 GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser', '~> v1');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns latest v2 GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', '~> v2');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns latest v2 GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser', '~> v2');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns nightly GoReleaser GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser', 'nightly');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns nightly GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', 'nightly');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).not.toEqual('');
|
||||
});
|
||||
|
||||
it('returns v0.182.0 GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', 'v0.182.0');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v0.182.0-pro');
|
||||
});
|
||||
|
||||
it('returns v0.182.1 GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', '~> 0.182');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v0.182.1-pro');
|
||||
});
|
||||
|
||||
it('returns v2.7.0 GoReleaser Pro GitHub release', async () => {
|
||||
const release = await github.getRelease('goreleaser-pro', '~> v2.7');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v2.7.0');
|
||||
});
|
||||
|
||||
it('skips JSON check for specific version v2.8.1', async () => {
|
||||
const release = await github.getRelease('goreleaser', 'v2.8.1');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v2.8.1');
|
||||
});
|
||||
|
||||
it('skips JSON check for specific version without v prefix', async () => {
|
||||
const release = await github.getRelease('goreleaser', '2.8.1');
|
||||
expect(release).not.toBeNull();
|
||||
expect(release?.tag_name).toEqual('v2.8.1');
|
||||
});
|
||||
|
||||
it('unknown GoReleaser Pro release', async () => {
|
||||
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow(
|
||||
new Error('Cannot find GoReleaser release foo in https://goreleaser.com/static/releases-pro.json')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import {describe, expect, it} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as goreleaser from '../src/goreleaser';
|
||||
|
||||
describe('install', () => {
|
||||
it('acquires v0.182.0 version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v0.182.0');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'latest');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v0.182.0-pro version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', 'v0.182.0-pro');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v1 version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', '~> v1');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v1 version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', '~> v1');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v2 version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', '~> v2');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest v2 version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', '~> v2');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', 'latest');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
});
|
||||
|
||||
describe('distribSuffix', () => {
|
||||
it('suffixes pro distribution', async () => {
|
||||
expect(goreleaser.distribSuffix('goreleaser-pro')).toEqual('-pro');
|
||||
});
|
||||
|
||||
it('does not suffix oss distribution', async () => {
|
||||
expect(goreleaser.distribSuffix('goreleaser')).toEqual('');
|
||||
});
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
import fs = require('fs');
|
||||
import * as installer from '../src/installer';
|
||||
|
||||
describe('installer', () => {
|
||||
it('acquires v0.117.0 version of GoReleaser', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('v0.117.0');
|
||||
console.log(goreleaser);
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('latest');
|
||||
console.log(goreleaser);
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
});
|
||||
+21
-6
@@ -1,23 +1,38 @@
|
||||
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
|
||||
name: 'GoReleaser Action'
|
||||
description: 'GitHub Action for GoReleaser, a release automation tool for Go projects'
|
||||
author: 'crazy-max'
|
||||
author: 'goreleaser'
|
||||
branding:
|
||||
color: 'green'
|
||||
icon: 'package'
|
||||
|
||||
inputs:
|
||||
distribution:
|
||||
description: 'GoReleaser Distribution (goreleaser or goreleaser-pro)'
|
||||
default: 'goreleaser'
|
||||
required: false
|
||||
version:
|
||||
description: 'GoReleaser version. Example: v0.118.0'
|
||||
default: 'latest'
|
||||
description: 'GoReleaser version'
|
||||
default: '~> v2'
|
||||
required: false
|
||||
args:
|
||||
description: 'Arguments to pass to GoReleaser'
|
||||
key:
|
||||
description: 'Private key to import'
|
||||
required: false
|
||||
workdir:
|
||||
description: 'Working directory (below repository root)'
|
||||
default: '.'
|
||||
required: false
|
||||
install-only:
|
||||
description: 'Just install GoReleaser'
|
||||
default: 'false'
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
artifacts:
|
||||
description: 'Build result artifacts'
|
||||
metadata:
|
||||
description: 'Build result metadata'
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=20
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
WORKDIR /src
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||
corepack enable
|
||||
yarn --version
|
||||
yarn config set --home enableTelemetry 0
|
||||
EOT
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||
|
||||
FROM scratch AS vendor-update
|
||||
COPY --from=deps /vendor /
|
||||
|
||||
FROM deps AS vendor-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS build
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||
|
||||
FROM scratch AS build-update
|
||||
COPY --from=build /out /
|
||||
|
||||
FROM build AS build-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
git status --porcelain -- dist
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS format
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run format \
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||
|
||||
FROM scratch AS format-update
|
||||
COPY --from=format /out /
|
||||
|
||||
FROM deps AS lint
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM deps AS test
|
||||
ENV RUNNER_TEMP=/tmp/github_runner
|
||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
+4
-5070
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+452
@@ -0,0 +1,452 @@
|
||||
@actions/core
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/tool-cache
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
ansi-regex
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
ansi-styles
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
cliui
|
||||
ISC
|
||||
Copyright (c) 2015, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
color-convert
|
||||
MIT
|
||||
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
color-name
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2015 Dmitry Ivanov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
emoji-regex
|
||||
MIT
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
escalade
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
get-caller-file
|
||||
ISC
|
||||
ISC License (ISC)
|
||||
Copyright 2018 Stefan Penner
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
is-fullwidth-code-point
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
js-yaml
|
||||
MIT
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2011-2015 by Vitaly Puzrin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
require-directory
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011 Troy Goode <troygoode@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
semver
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
string-width
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
strip-ansi
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Koichi Kobayashi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
undici
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
wrap-ansi
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
y18n
|
||||
ISC
|
||||
Copyright (c) 2015, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
|
||||
yargs
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
yargs-parser
|
||||
ISC
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,61 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
|
||||
group "pre-checkin" {
|
||||
targets = ["vendor", "format", "build"]
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
targets = ["lint", "build-validate", "vendor-validate"]
|
||||
}
|
||||
|
||||
target "build" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
setupFiles: ["dotenv/config"],
|
||||
testEnvironment: 'node',
|
||||
setupFiles: ['dotenv/config', '<rootDir>/src/test_setup.ts'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
testTimeout: 30000,
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: false
|
||||
}
|
||||
verbose: true
|
||||
};
|
||||
Generated
-5747
File diff suppressed because it is too large
Load Diff
+34
-24
@@ -1,14 +1,17 @@
|
||||
{
|
||||
"name": "goreleaser-action",
|
||||
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
|
||||
"main": "lib/main.js",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "tsc && ncc build",
|
||||
"test": "jest --coverage",
|
||||
"format": "prettier --write **/*.ts",
|
||||
"format-check": "prettier --check **/*.ts",
|
||||
"cleanup-paths": "removeNPMAbsolutePaths ./ --force --fields _where _args",
|
||||
"pre-checkin": "npm run format && npm run cleanup-paths && npm run build"
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "yarn run prettier && yarn run eslint",
|
||||
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||
"eslint": "eslint --max-warnings=0 .",
|
||||
"eslint:fix": "eslint --fix .",
|
||||
"prettier": "prettier --check \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "jest",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,24 +24,31 @@
|
||||
],
|
||||
"author": "CrazyMax",
|
||||
"license": "MIT",
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.4",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/http-client": "^1.0.8",
|
||||
"@actions/tool-cache": "^1.3.4"
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/http-client": "^2.2.3",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"semver": "^7.7.2",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "^13.13.5",
|
||||
"@zeit/ncc": "^0.22.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"jest": "^25.5.4",
|
||||
"jest-circus": "^25.5.4",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"prettier": "^2.0.5",
|
||||
"removeNPMAbsolutePaths": "^2.0.0",
|
||||
"ts-jest": "^25.5.0",
|
||||
"typescript": "^3.8.3",
|
||||
"typescript-formatter": "^7.2.2"
|
||||
"@types/node": "^20.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/parser": "^6.6.0",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"jest": "^29.6.4",
|
||||
"prettier": "^3.0.3",
|
||||
"tmp": "^0.2.1",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import * as os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
export const osPlat: string = os.platform();
|
||||
export const osArch: string = os.arch();
|
||||
|
||||
export interface Inputs {
|
||||
distribution: string;
|
||||
version: string;
|
||||
args: string;
|
||||
workdir: string;
|
||||
installOnly: boolean;
|
||||
}
|
||||
|
||||
export async function getInputs(): Promise<Inputs> {
|
||||
return {
|
||||
distribution: core.getInput('distribution') || 'goreleaser',
|
||||
version: core.getInput('version') || '~> v2',
|
||||
args: core.getInput('args'),
|
||||
workdir: core.getInput('workdir') || '.',
|
||||
installOnly: core.getBooleanInput('install-only')
|
||||
};
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import * as actionsExec from '@actions/exec';
|
||||
import {ExecOptions} from '@actions/exec';
|
||||
|
||||
export interface ExecResult {
|
||||
success: boolean;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
export const exec = async (command: string, args: string[] = [], silent: boolean): Promise<ExecResult> => {
|
||||
let stdout: string = '';
|
||||
let stderr: string = '';
|
||||
|
||||
const options: ExecOptions = {
|
||||
silent: silent,
|
||||
ignoreReturnCode: true
|
||||
};
|
||||
options.listeners = {
|
||||
stdout: (data: Buffer) => {
|
||||
stdout += data.toString();
|
||||
},
|
||||
stderr: (data: Buffer) => {
|
||||
stderr += data.toString();
|
||||
}
|
||||
};
|
||||
|
||||
const returnCode: number = await actionsExec.exec(command, args, options);
|
||||
|
||||
return {
|
||||
success: returnCode === 0,
|
||||
stdout: stdout.trim(),
|
||||
stderr: stderr.trim()
|
||||
};
|
||||
};
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
import * as exec from './exec';
|
||||
|
||||
const git = async (args: string[] = []): Promise<string> => {
|
||||
return await exec.exec(`git`, args, true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
return res.stdout.trim();
|
||||
});
|
||||
};
|
||||
|
||||
export async function getTag(): Promise<string> {
|
||||
try {
|
||||
return await git(['describe', '--tags', '--abbrev=0']);
|
||||
} catch (err) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
export async function isTagDirty(currentTag: string): Promise<boolean> {
|
||||
try {
|
||||
await git(['describe', '--exact-match', '--tags', '--match', currentTag]);
|
||||
} catch (err) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function getShortCommit(): Promise<string> {
|
||||
return await git(['show', "--format='%h'", 'HEAD', '--quiet']);
|
||||
}
|
||||
+119
-5
@@ -1,12 +1,126 @@
|
||||
import * as goreleaser from './goreleaser';
|
||||
import * as semver from 'semver';
|
||||
import * as core from '@actions/core';
|
||||
import * as httpm from '@actions/http-client';
|
||||
|
||||
const maxRetries = 10;
|
||||
const timeoutMs = 1000;
|
||||
const withRetry = async <T>(operation: () => Promise<T>): Promise<T> => {
|
||||
let lastError: Error;
|
||||
|
||||
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
||||
try {
|
||||
return await operation();
|
||||
} catch (error) {
|
||||
lastError = error as Error;
|
||||
|
||||
if (attempt === maxRetries) {
|
||||
break;
|
||||
}
|
||||
|
||||
core.debug(`Attempt ${attempt + 1} failed, retrying in ${timeoutMs}: ${lastError.message}`);
|
||||
await new Promise(resolve => setTimeout(resolve, timeoutMs));
|
||||
}
|
||||
}
|
||||
|
||||
throw lastError;
|
||||
};
|
||||
|
||||
export interface GitHubRelease {
|
||||
id: number;
|
||||
tag_name: string;
|
||||
}
|
||||
|
||||
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
|
||||
const url: string = `https://github.com/goreleaser/goreleaser/releases/${version}`;
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||
return (await http.getJson<GitHubRelease>(url)).result;
|
||||
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||
if (version === 'latest') {
|
||||
core.warning("You are using 'latest' as default version. Will lock to '~> v2'.");
|
||||
return getReleaseTag(distribution, '~> v2');
|
||||
}
|
||||
return getReleaseTag(distribution, version);
|
||||
};
|
||||
|
||||
export const getReleaseTag = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||
if (version === 'nightly') {
|
||||
return {tag_name: version};
|
||||
}
|
||||
|
||||
// If version is a specific version (not a range), skip the JSON check
|
||||
const cleanVersion: string = cleanTag(version);
|
||||
if (semver.valid(cleanVersion)) {
|
||||
let tag = version.startsWith('v') ? version : `v${version}`;
|
||||
|
||||
// Handle GoReleaser Pro suffix for versions < 2.7.0, but only if not already present
|
||||
// TODO: remove all this `-pro` thing at some point.
|
||||
if (goreleaser.isPro(distribution) && semver.lt(cleanVersion, '2.7.0') && !tag.endsWith('-pro')) {
|
||||
tag = tag + goreleaser.distribSuffix(distribution);
|
||||
}
|
||||
|
||||
return {tag_name: tag};
|
||||
}
|
||||
|
||||
const tag: string = (await resolveVersion(distribution, version)) || version;
|
||||
const suffix: string = goreleaser.distribSuffix(distribution);
|
||||
const url = `https://goreleaser.com/static/releases${suffix}.json`;
|
||||
|
||||
const releases = await withRetry(async () => {
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||
const resp: httpm.HttpClientResponse = await http.get(url);
|
||||
const body = await resp.readBody();
|
||||
const statusCode = resp.message.statusCode || 500;
|
||||
if (statusCode >= 400) {
|
||||
throw new Error(
|
||||
`Failed to get GoReleaser release ${version} from ${url} with status code ${statusCode}: ${body}`
|
||||
);
|
||||
}
|
||||
return <Array<GitHubRelease>>JSON.parse(body);
|
||||
});
|
||||
|
||||
const res = releases.filter(r => r.tag_name === tag).shift();
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
throw new Error(`Cannot find GoReleaser release ${version} in ${url}`);
|
||||
};
|
||||
|
||||
const resolveVersion = async (distribution: string, version: string): Promise<string | null> => {
|
||||
const allTags: Array<string> | null = await getAllTags(distribution);
|
||||
if (!allTags) {
|
||||
throw new Error(`Cannot download ${distribution} tags`);
|
||||
}
|
||||
core.debug(`Found ${allTags.length} tags in total`);
|
||||
|
||||
const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag));
|
||||
const cleanVersion: string = cleanTag(version);
|
||||
if (!semver.valid(cleanVersion) && !semver.validRange(cleanVersion)) {
|
||||
// if the given version is invalid, return whatever we got.
|
||||
return version;
|
||||
}
|
||||
const v = semver.maxSatisfying(cleanTags, cleanVersion);
|
||||
if (semver.lt(v, '2.7.0')) {
|
||||
// if its a version older than 2.7.0, append the suffix.
|
||||
return v + goreleaser.distribSuffix(distribution);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
|
||||
interface GitHubTag {
|
||||
tag_name: string;
|
||||
}
|
||||
|
||||
const getAllTags = async (distribution: string): Promise<Array<string>> => {
|
||||
const suffix: string = goreleaser.distribSuffix(distribution);
|
||||
const url = `https://goreleaser.com/static/releases${suffix}.json`;
|
||||
core.debug(`Downloading ${url}`);
|
||||
|
||||
return withRetry(async () => {
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||
const response = await http.getJson<Array<GitHubTag>>(url);
|
||||
if (response.result == null) {
|
||||
return [];
|
||||
}
|
||||
return response.result.map(obj => obj.tag_name);
|
||||
});
|
||||
};
|
||||
|
||||
const cleanTag = (tag: string): string => {
|
||||
return tag.replace(/-pro$/, '');
|
||||
};
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
import yaml from 'js-yaml';
|
||||
import * as context from './context';
|
||||
import * as github from './github';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
export async function install(distribution: string, version: string): Promise<string> {
|
||||
const release: github.GitHubRelease = await github.getRelease(distribution, version);
|
||||
const filename = getFilename(distribution);
|
||||
const downloadUrl = util.format(
|
||||
'https://github.com/goreleaser/%s/releases/download/%s/%s',
|
||||
distribution,
|
||||
release.tag_name,
|
||||
filename
|
||||
);
|
||||
|
||||
core.info(`Downloading ${downloadUrl}`);
|
||||
const downloadPath: string = await tc.downloadTool(downloadUrl);
|
||||
core.debug(`Downloaded to ${downloadPath}`);
|
||||
|
||||
core.info('Extracting GoReleaser');
|
||||
let extPath: string;
|
||||
if (context.osPlat == 'win32') {
|
||||
if (!downloadPath.endsWith('.zip')) {
|
||||
const newPath = downloadPath + '.zip';
|
||||
fs.renameSync(downloadPath, newPath);
|
||||
extPath = await tc.extractZip(newPath);
|
||||
} else {
|
||||
extPath = await tc.extractZip(downloadPath);
|
||||
}
|
||||
} else {
|
||||
extPath = await tc.extractTar(downloadPath);
|
||||
}
|
||||
core.debug(`Extracted to ${extPath}`);
|
||||
|
||||
const cachePath: string = await tc.cacheDir(extPath, 'goreleaser-action', release.tag_name.replace(/^v/, ''));
|
||||
core.debug(`Cached to ${cachePath}`);
|
||||
|
||||
const exePath: string = path.join(cachePath, context.osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser');
|
||||
core.debug(`Exe path is ${exePath}`);
|
||||
|
||||
return exePath;
|
||||
}
|
||||
|
||||
export const distribSuffix = (distribution: string): string => {
|
||||
return isPro(distribution) ? '-pro' : '';
|
||||
};
|
||||
|
||||
export const isPro = (distribution: string): boolean => {
|
||||
return distribution === 'goreleaser-pro';
|
||||
};
|
||||
|
||||
const getFilename = (distribution: string): string => {
|
||||
let arch: string;
|
||||
switch (context.osArch) {
|
||||
case 'x64': {
|
||||
arch = 'x86_64';
|
||||
break;
|
||||
}
|
||||
case 'x32': {
|
||||
arch = 'i386';
|
||||
break;
|
||||
}
|
||||
case 'arm': {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const arm_version = (process.config.variables as any).arm_version;
|
||||
arch = arm_version ? 'armv' + arm_version : 'arm';
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
arch = context.osArch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (context.osPlat == 'darwin') {
|
||||
arch = 'all';
|
||||
}
|
||||
const platform: string = context.osPlat == 'win32' ? 'Windows' : context.osPlat == 'darwin' ? 'Darwin' : 'Linux';
|
||||
const ext: string = context.osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||
const suffix: string = distribSuffix(distribution);
|
||||
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);
|
||||
};
|
||||
|
||||
export async function getDistPath(yamlfile: string): Promise<string> {
|
||||
const cfg = yaml.load(fs.readFileSync(yamlfile, 'utf8'));
|
||||
return cfg.dist || 'dist';
|
||||
}
|
||||
|
||||
export async function getArtifacts(distpath: string): Promise<string | undefined> {
|
||||
const artifactsFile = path.join(distpath, 'artifacts.json');
|
||||
if (!fs.existsSync(artifactsFile)) {
|
||||
return undefined;
|
||||
}
|
||||
const content = fs.readFileSync(artifactsFile, {encoding: 'utf-8'}).trim();
|
||||
if (content === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
export async function getMetadata(distpath: string): Promise<string | undefined> {
|
||||
const metadataFile = path.join(distpath, 'metadata.json');
|
||||
if (!fs.existsSync(metadataFile)) {
|
||||
return undefined;
|
||||
}
|
||||
const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
|
||||
if (content === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
import * as github from './github';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
const osPlat: string = os.platform();
|
||||
const osArch: string = os.arch();
|
||||
|
||||
export async function getGoReleaser(version: string): Promise<string> {
|
||||
const release: github.GitHubRelease | null = await github.getRelease(version);
|
||||
if (!release) {
|
||||
throw new Error(`Cannot find GoReleaser ${version} release`);
|
||||
}
|
||||
|
||||
core.info(`✅ GoReleaser version found: ${release.tag_name}`);
|
||||
const filename = getFilename();
|
||||
const downloadUrl = util.format(
|
||||
'https://github.com/goreleaser/goreleaser/releases/download/%s/%s',
|
||||
release.tag_name,
|
||||
filename
|
||||
);
|
||||
|
||||
core.info(`⬇️ Downloading ${downloadUrl}...`);
|
||||
const downloadPath: string = await tc.downloadTool(downloadUrl);
|
||||
core.debug(`Downloaded to ${downloadPath}`);
|
||||
|
||||
core.info('📦 Extracting GoReleaser...');
|
||||
let extPath: string;
|
||||
if (osPlat == 'win32') {
|
||||
extPath = await tc.extractZip(downloadPath);
|
||||
} else {
|
||||
extPath = await tc.extractTar(downloadPath);
|
||||
}
|
||||
core.debug(`Extracted to ${extPath}`);
|
||||
|
||||
const cachePath: string = await tc.cacheDir(extPath, 'goreleaser-action', release.tag_name.replace(/^v/, ''));
|
||||
core.debug(`Cached to ${cachePath}`);
|
||||
|
||||
const exePath: string = path.join(cachePath, osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser');
|
||||
core.debug(`Exe path is ${exePath}`);
|
||||
|
||||
return exePath;
|
||||
}
|
||||
|
||||
const getFilename = (): string => {
|
||||
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';
|
||||
return util.format('goreleaser_%s_%s.%s', platform, arch, ext);
|
||||
};
|
||||
+55
-33
@@ -1,47 +1,69 @@
|
||||
import * as git from './git';
|
||||
import * as installer from './installer';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import yargs from 'yargs';
|
||||
import * as context from './context';
|
||||
import * as goreleaser from './goreleaser';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as fs from 'fs';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
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);
|
||||
const inputs: context.Inputs = await context.getInputs();
|
||||
const bin = await goreleaser.install(inputs.distribution, inputs.version);
|
||||
core.info(`GoReleaser ${inputs.version} installed successfully`);
|
||||
|
||||
const commit = await git.getShortCommit();
|
||||
const tag = await git.getTag();
|
||||
const isTagDirty = await git.isTagDirty(tag);
|
||||
|
||||
if (workdir && workdir !== '.') {
|
||||
core.info(`📂 Using ${workdir} as working directory...`);
|
||||
process.chdir(workdir);
|
||||
if (inputs.installOnly) {
|
||||
const goreleaserDir = path.dirname(bin);
|
||||
core.addPath(goreleaserDir);
|
||||
core.debug(`Added ${goreleaserDir} to PATH`);
|
||||
return;
|
||||
} else if (!inputs.args) {
|
||||
core.setFailed('args input required');
|
||||
return;
|
||||
}
|
||||
|
||||
let snapshot = '';
|
||||
if (args.split(' ').indexOf('release') > -1) {
|
||||
if (isTagDirty) {
|
||||
core.info(`⚠️ No tag found for commit ${commit}. Snapshot forced`);
|
||||
if (!args.includes('--snapshot')) {
|
||||
snapshot = ' --snapshot';
|
||||
if (inputs.workdir && inputs.workdir !== '.') {
|
||||
core.info(`Using ${inputs.workdir} as working directory`);
|
||||
process.chdir(inputs.workdir);
|
||||
}
|
||||
|
||||
let yamlfile: string | unknown;
|
||||
const argv: {config: string} = yargs.parse(inputs.args) as never;
|
||||
if (argv.config) {
|
||||
yamlfile = argv.config;
|
||||
} else {
|
||||
[
|
||||
'.config/goreleaser.yaml',
|
||||
'.config/goreleaser.yml',
|
||||
'.goreleaser.yaml',
|
||||
'.goreleaser.yml',
|
||||
'goreleaser.yaml',
|
||||
'goreleaser.yml'
|
||||
].forEach(f => {
|
||||
if (fs.existsSync(f)) {
|
||||
yamlfile = f;
|
||||
}
|
||||
} else {
|
||||
core.info(`✅ ${tag} tag found for commit ${commit}`);
|
||||
});
|
||||
}
|
||||
|
||||
await exec.exec(`${bin} ${inputs.args}`);
|
||||
|
||||
if (typeof yamlfile === 'string') {
|
||||
const artifacts = await goreleaser.getArtifacts(await goreleaser.getDistPath(yamlfile));
|
||||
if (artifacts) {
|
||||
await core.group(`Artifacts output`, async () => {
|
||||
core.info(artifacts);
|
||||
core.setOutput('artifacts', artifacts);
|
||||
});
|
||||
}
|
||||
const metadata = await goreleaser.getMetadata(await goreleaser.getDistPath(yamlfile));
|
||||
if (metadata) {
|
||||
await core.group(`Metadata output`, async () => {
|
||||
core.info(metadata);
|
||||
core.setOutput('metadata', metadata);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (key) {
|
||||
core.info('🔑 Importing signing key...');
|
||||
let path = `${process.env.HOME}/key.asc`;
|
||||
fs.writeFileSync(path, key, {mode: 0o600});
|
||||
await exec.exec('gpg', ['--import', path]);
|
||||
}
|
||||
|
||||
core.info('🏃 Running GoReleaser...');
|
||||
await exec.exec(`${goreleaser} ${args}${snapshot}`);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import tmp = require('tmp');
|
||||
|
||||
tmp.setGracefulCleanup();
|
||||
const tmpdir = tmp.dirSync({template: 'goreleaser-XXXXXX'});
|
||||
process.env = Object.assign(process.env, {
|
||||
RUNNER_TEMP: tmpdir.name,
|
||||
RUNNER_TOOL_CACHE: tmpdir.name,
|
||||
GITHUB_ACTION: '1'
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod download
|
||||
|
||||
builds:
|
||||
-
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
dist: _output
|
||||
@@ -0,0 +1,26 @@
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod download
|
||||
|
||||
builds:
|
||||
-
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
goarch:
|
||||
- "386"
|
||||
- "amd64"
|
||||
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
|
||||
signs:
|
||||
-
|
||||
artifacts: checksum
|
||||
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||
@@ -0,0 +1,21 @@
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod download
|
||||
|
||||
builds:
|
||||
-
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
goarch:
|
||||
- "386"
|
||||
- "amd64"
|
||||
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
@@ -1,3 +1,3 @@
|
||||
module github.com/goreleaser/goreleaser-action
|
||||
|
||||
go 1.12
|
||||
go 1.18
|
||||
+9
-7
@@ -1,17 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noImplicitAny": false,
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user