mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-29 14:28:29 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
+11
-1
@@ -1,2 +1,12 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/node_modules
|
|
||||||
|
# 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/**
|
||||||
+3
-2
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es2021": true,
|
"es6": true,
|
||||||
"jest/globals": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:jest/recommended",
|
"plugin:jest/recommended",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended"
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
/.yarn/releases/** binary
|
||||||
|
/.yarn/plugins/** binary
|
||||||
/dist/** linguist-generated=true
|
/dist/** linguist-generated=true
|
||||||
/lib/** linguist-generated=true
|
/lib/** linguist-generated=true
|
||||||
|
|||||||
+70
-28
@@ -1,8 +1,13 @@
|
|||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *' # everyday at 10am
|
- cron: '0 10 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
@@ -10,9 +15,6 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -22,23 +24,24 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macOS-latest
|
- macos-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
version:
|
version:
|
||||||
- latest
|
- latest
|
||||||
- '~> 0.182'
|
- '~> 2.6'
|
||||||
|
- '~> 1.26'
|
||||||
distribution:
|
distribution:
|
||||||
- goreleaser
|
- goreleaser
|
||||||
- goreleaser-pro
|
- goreleaser-pro
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
-
|
-
|
||||||
@@ -46,7 +49,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
args: check --debug
|
args: check --verbose
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: GoReleaser
|
name: GoReleaser
|
||||||
@@ -57,7 +60,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
args: release --skip-publish --rm-dist --snapshot
|
args: release --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
|
|
||||||
install-only:
|
install-only:
|
||||||
@@ -67,19 +70,20 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- latest
|
- latest
|
||||||
- '~> 0.166'
|
- '~> 2.6'
|
||||||
|
- '~> 1.26'
|
||||||
distribution:
|
distribution:
|
||||||
- goreleaser
|
- goreleaser
|
||||||
- goreleaser-pro
|
- goreleaser-pro
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
-
|
-
|
||||||
@@ -94,7 +98,7 @@ jobs:
|
|||||||
name: Check
|
name: Check
|
||||||
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
|
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
|
||||||
run: |
|
run: |
|
||||||
goreleaser check --debug
|
goreleaser check --verbose
|
||||||
|
|
||||||
signing:
|
signing:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -104,23 +108,23 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macOS-latest
|
- macos-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
-
|
-
|
||||||
name: Import GPG key
|
name: Import GPG key
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v5
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
||||||
@@ -129,7 +133,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: -f .goreleaser-signing.yml check --debug
|
args: -f .goreleaser-signing.yml check --verbose
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
env:
|
env:
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||||
@@ -138,7 +142,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist --snapshot
|
args: -f .goreleaser-signing.yml release --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
env:
|
env:
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||||
@@ -148,29 +152,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
-
|
-
|
||||||
name: Check
|
name: Check
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
args: check --debug
|
args: check --verbose
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: GoReleaser
|
name: GoReleaser
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
args: release --skip-publish --rm-dist --snapshot
|
args: release --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: Upload assets
|
name: Upload assets
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: myapp
|
name: myapp
|
||||||
path: ./test/dist/*
|
path: ./test/dist/*
|
||||||
@@ -180,21 +184,59 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: 1.18
|
||||||
-
|
-
|
||||||
name: GoReleaser
|
name: GoReleaser
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
args: release --config .goreleaser-dist.yml --skip-publish --rm-dist --snapshot
|
args: release --config .goreleaser-dist.yml --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: Check dist
|
name: Check dist
|
||||||
run: |
|
run: |
|
||||||
tree -nh ./test/_output
|
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,14 +1,15 @@
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'releases/v*'
|
- 'releases/v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@@ -16,21 +17,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
|
||||||
name: Validate
|
|
||||||
uses: docker/bake-action@v2
|
|
||||||
with:
|
|
||||||
targets: validate
|
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v2
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
files: ./coverage/clover.xml
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: validate
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
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
|
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
node_modules/
|
|
||||||
lib
|
|
||||||
|
|
||||||
# Jetbrains
|
|
||||||
/.idea
|
|
||||||
/*.iml
|
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
@@ -24,34 +18,14 @@ pids
|
|||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage
|
||||||
*.lcov
|
*.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
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
# TypeScript cache
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
@@ -61,36 +35,19 @@ typings/
|
|||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
# dotenv environment variable files
|
||||||
.env
|
.env
|
||||||
.env.test
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# yarn v2
|
||||||
.cache
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
# next.js build output
|
.yarn/build-state.yml
|
||||||
.next
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
version = 1
|
|
||||||
|
|
||||||
[merge]
|
|
||||||
automerge_label = "automerge"
|
|
||||||
blacklist_title_regex = "^WIP.*"
|
|
||||||
method = "squash"
|
|
||||||
delete_branch_on_merge = true
|
|
||||||
block_on_reviews_requested = false
|
|
||||||
notify_on_conflict = true
|
|
||||||
optimistic_updates = true
|
|
||||||
|
|
||||||
[merge.message]
|
|
||||||
title = "pull_request_title"
|
|
||||||
include_pr_number = true
|
|
||||||
body_type = "markdown"
|
|
||||||
@@ -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"
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<p align="center">
|
<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/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/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://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>
|
||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
@@ -30,6 +30,12 @@ ___
|
|||||||
|
|
||||||
## Usage
|
## 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
|
### Workflow
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -39,26 +45,30 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
# either 'goreleaser' (default) or 'goreleaser-pro'
|
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
# 'latest', 'nightly', or a semver
|
||||||
args: release --rm-dist
|
version: '~> v2'
|
||||||
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
|
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
|
||||||
@@ -83,11 +93,11 @@ Or with a condition on GoReleaser step:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --rm-dist
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
@@ -103,16 +113,16 @@ the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action
|
|||||||
-
|
-
|
||||||
name: Import GPG key
|
name: Import GPG key
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v5
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --rm-dist
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||||
@@ -129,21 +139,21 @@ signs:
|
|||||||
### Upload artifacts
|
### Upload artifacts
|
||||||
|
|
||||||
For some events like pull request or schedule you might want to store the artifacts somewhere for testing
|
For some events like pull request or schedule you might want to store the artifacts somewhere for testing
|
||||||
purpose. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
|
purposes. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --rm-dist
|
args: release --clean
|
||||||
workdir: myfolder
|
workdir: myfolder
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Upload assets
|
name: Upload assets
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: myapp
|
name: myapp
|
||||||
path: myfolder/dist/*
|
path: myfolder/dist/*
|
||||||
@@ -155,7 +165,7 @@ purpose. You can do that with the [actions/upload-artifact](https://github.com/a
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Install GoReleaser
|
name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
-
|
-
|
||||||
@@ -172,7 +182,7 @@ Following inputs can be used as `step.with` keys
|
|||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|------------------|---------|--------------|------------------------------------------------------------------|
|
|------------------|---------|--------------|------------------------------------------------------------------|
|
||||||
| `distribution` | String | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` |
|
| `distribution` | String | `goreleaser` | GoReleaser distribution, either `goreleaser` or `goreleaser-pro` |
|
||||||
| `version`**¹** | String | `latest` | GoReleaser version |
|
| `version`**¹** | String | `~> v2` | GoReleaser version |
|
||||||
| `args` | String | | Arguments to pass to GoReleaser |
|
| `args` | String | | Arguments to pass to GoReleaser |
|
||||||
| `workdir` | String | `.` | Working directory (below repository root) |
|
| `workdir` | String | `.` | Working directory (below repository root) |
|
||||||
| `install-only` | Bool | `false` | Just install GoReleaser |
|
| `install-only` | Bool | `false` | Just install GoReleaser |
|
||||||
@@ -183,18 +193,18 @@ Following inputs can be used as `step.with` keys
|
|||||||
|
|
||||||
Following outputs are available
|
Following outputs are available
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|-------------------|---------|---------------------------------------|
|
|-------------|------|------------------------|
|
||||||
| `artifacts` | JSON | Build result artifacts |
|
| `artifacts` | JSON | Build result artifacts |
|
||||||
| `metadata` | JSON | Build result metadata |
|
| `metadata` | JSON | Build result metadata |
|
||||||
|
|
||||||
### environment variables
|
### environment variables
|
||||||
|
|
||||||
Following environment variables can be used as `step.env` keys
|
Following environment variables can be used as `step.env` keys
|
||||||
|
|
||||||
| Name | Description |
|
| 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` |
|
| `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 |
|
| `GORELEASER_KEY` | Your [GoReleaser Pro](https://goreleaser.com/pro) License Key, in case you are using the `goreleaser-pro` distribution |
|
||||||
|
|
||||||
## Limitation
|
## Limitation
|
||||||
@@ -209,14 +219,18 @@ secret named `GH_PAT`, the step will look like this:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --rm-dist
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Migrating from v3
|
||||||
|
|
||||||
|
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
|
## Development
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {describe, expect, it} from '@jest/globals';
|
import {describe, expect, it} from '@jest/globals';
|
||||||
import * as github from '../src/github';
|
import * as github from '../src/github';
|
||||||
|
|
||||||
describe('github', () => {
|
describe('getRelease', () => {
|
||||||
it('returns latest GoReleaser GitHub release', async () => {
|
it('returns latest GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser', 'latest');
|
const release = await github.getRelease('goreleaser', 'latest');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
@@ -20,21 +20,75 @@ describe('github', () => {
|
|||||||
expect(release?.tag_name).toEqual('v0.182.1');
|
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 () => {
|
it('returns latest GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', 'latest');
|
const release = await github.getRelease('goreleaser-pro', 'latest');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).not.toEqual('');
|
expect(release?.tag_name).not.toEqual('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns v0.182.0-pro GoReleaser Pro GitHub release', async () => {
|
it('returns latest v1 GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', 'v0.182.0-pro');
|
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).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.182.0-pro');
|
expect(release?.tag_name).toEqual('v0.182.0-pro');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns v0.182.1-pro GoReleaser Pro GitHub release when using semver', async () => {
|
it('returns v0.182.1 GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', '~> 0.182');
|
const release = await github.getRelease('goreleaser-pro', '~> 0.182');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.182.1-pro');
|
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('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')
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,26 @@ describe('install', () => {
|
|||||||
expect(fs.existsSync(bin)).toBe(true);
|
expect(fs.existsSync(bin)).toBe(true);
|
||||||
}, 100000);
|
}, 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 () => {
|
it('acquires latest version of GoReleaser Pro', async () => {
|
||||||
const bin = await goreleaser.install('goreleaser-pro', 'latest');
|
const bin = await goreleaser.install('goreleaser-pro', 'latest');
|
||||||
expect(fs.existsSync(bin)).toBe(true);
|
expect(fs.existsSync(bin)).toBe(true);
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'GoReleaser version'
|
description: 'GoReleaser version'
|
||||||
default: 'latest'
|
default: '~> v2'
|
||||||
required: false
|
required: false
|
||||||
args:
|
args:
|
||||||
description: 'Arguments to pass to GoReleaser'
|
description: 'Arguments to pass to GoReleaser'
|
||||||
@@ -34,5 +34,5 @@ outputs:
|
|||||||
description: 'Build result metadata'
|
description: 'Build result metadata'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
+30
-19
@@ -1,13 +1,20 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=16
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS base
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
RUN apk add --no-cache cpio findutils git
|
RUN apk add --no-cache cpio findutils git
|
||||||
WORKDIR /src
|
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
|
FROM base AS deps
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||||
|
|
||||||
@@ -16,18 +23,19 @@ COPY --from=deps /vendor /
|
|||||||
|
|
||||||
FROM deps AS vendor-validate
|
FROM deps AS vendor-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=type=bind,target=.,rw <<EOT
|
||||||
set -e
|
set -e
|
||||||
git add -A
|
git add -A
|
||||||
cp -rf /vendor/* .
|
cp -rf /vendor/* .
|
||||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||||
git status --porcelain -- yarn.lock
|
git status --porcelain -- yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||||
|
|
||||||
@@ -36,27 +44,29 @@ COPY --from=build /out /
|
|||||||
|
|
||||||
FROM build AS build-validate
|
FROM build AS build-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=type=bind,target=.,rw <<EOT
|
||||||
set -e
|
set -e
|
||||||
git add -A
|
git add -A
|
||||||
cp -rf /out/* .
|
cp -rf /out/* .
|
||||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||||
git status --porcelain -- dist
|
git status --porcelain -- dist
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS format
|
FROM deps AS format
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run format \
|
yarn run format \
|
||||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||||
|
|
||||||
FROM scratch AS format-update
|
FROM scratch AS format-update
|
||||||
COPY --from=format /out /
|
COPY --from=format /out /
|
||||||
|
|
||||||
FROM deps AS lint
|
FROM deps AS lint
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
@@ -64,8 +74,9 @@ FROM deps AS test
|
|||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
ENV RUNNER_TEMP=/tmp/github_runner
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run test --coverageDirectory=/tmp/coverage
|
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage /
|
COPY --from=test /tmp/coverage /
|
||||||
|
|||||||
+3
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+40
-6
@@ -71,6 +71,28 @@ The above copyright notice and this permission notice shall be included in all c
|
|||||||
|
|
||||||
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.
|
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
|
ansi-regex
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
@@ -332,17 +354,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
uuid
|
undici
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
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:
|
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 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.
|
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
|
wrap-ansi
|
||||||
|
|||||||
+10
-2
@@ -1,9 +1,15 @@
|
|||||||
|
target "_common" {
|
||||||
|
args = {
|
||||||
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "pre-checkin" {
|
group "pre-checkin" {
|
||||||
targets = ["vendor-update", "format", "build"]
|
targets = ["vendor", "format", "build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
@@ -17,6 +23,7 @@ target "build" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
@@ -34,13 +41,14 @@ target "lint" {
|
|||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-update" {
|
target "vendor" {
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
|
|||||||
+1
-4
@@ -1,10 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
setupFiles: [
|
setupFiles: ['dotenv/config', '<rootDir>/src/test_setup.ts'],
|
||||||
'dotenv/config',
|
|
||||||
'<rootDir>/src/test_setup.ts'
|
|
||||||
],
|
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
testTimeout: 30000,
|
testTimeout: 30000,
|
||||||
transform: {
|
transform: {
|
||||||
|
|||||||
+28
-22
@@ -1,12 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "goreleaser-action",
|
"name": "goreleaser-action",
|
||||||
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
|
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
|
||||||
"main": "lib/main.js",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
"lint": "yarn run prettier && yarn run eslint",
|
||||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||||
"test": "jest --coverage",
|
"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"
|
"all": "yarn run build && yarn run format && yarn test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -20,29 +24,31 @@
|
|||||||
],
|
],
|
||||||
"author": "CrazyMax",
|
"author": "CrazyMax",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.2.3",
|
||||||
"@actions/tool-cache": "^2.0.1",
|
"@actions/tool-cache": "^2.0.2",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"yargs": "^17.6.2"
|
"semver": "^7.7.1",
|
||||||
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.26",
|
"@types/node": "^20.6.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||||
"@typescript-eslint/parser": "^5.14.0",
|
"@typescript-eslint/parser": "^6.6.0",
|
||||||
"@vercel/ncc": "^0.33.3",
|
"@vercel/ncc": "^0.38.0",
|
||||||
"dotenv": "^16.0.0",
|
"dotenv": "^16.3.1",
|
||||||
"eslint": "^8.11.0",
|
"eslint": "^8.49.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-jest": "^26.1.1",
|
"eslint-plugin-jest": "^27.2.3",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^27.2.5",
|
"jest": "^29.6.4",
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^3.0.3",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^29.1.1",
|
||||||
"ts-node": "^10.7.0",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.4.4"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ export interface Inputs {
|
|||||||
export async function getInputs(): Promise<Inputs> {
|
export async function getInputs(): Promise<Inputs> {
|
||||||
return {
|
return {
|
||||||
distribution: core.getInput('distribution') || 'goreleaser',
|
distribution: core.getInput('distribution') || 'goreleaser',
|
||||||
version: core.getInput('version'),
|
version: core.getInput('version') || '~> v2',
|
||||||
args: core.getInput('args'),
|
args: core.getInput('args'),
|
||||||
workdir: core.getInput('workdir') || '.',
|
workdir: core.getInput('workdir') || '.',
|
||||||
installOnly: core.getBooleanInput('install-only')
|
installOnly: core.getBooleanInput('install-only')
|
||||||
|
|||||||
+39
-11
@@ -4,31 +4,58 @@ import * as core from '@actions/core';
|
|||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
|
|
||||||
export interface GitHubRelease {
|
export interface GitHubRelease {
|
||||||
id: number;
|
|
||||||
tag_name: string;
|
tag_name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease | null> => {
|
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||||
const resolvedVersion: string = (await resolveVersion(distribution, version)) || version;
|
if (version === 'latest') {
|
||||||
const url = `https://github.com/goreleaser/${distribution}/releases/${resolvedVersion}`;
|
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};
|
||||||
|
}
|
||||||
|
const tag: string = (await resolveVersion(distribution, version)) || version;
|
||||||
|
const suffix: string = goreleaser.distribSuffix(distribution);
|
||||||
|
const url = `https://goreleaser.com/static/releases${suffix}.json`;
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||||
return (await http.getJson<GitHubRelease>(url)).result;
|
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}`);
|
||||||
|
}
|
||||||
|
const releases = <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 resolveVersion = async (distribution: string, version: string): Promise<string | null> => {
|
||||||
const allTags: Array<string> | null = await getAllTags(distribution);
|
const allTags: Array<string> | null = await getAllTags(distribution);
|
||||||
if (!allTags) {
|
if (!allTags) {
|
||||||
throw new Error(`Cannot find GoReleaser tags`);
|
throw new Error(`Cannot download ${distribution} tags`);
|
||||||
}
|
}
|
||||||
core.debug(`Found ${allTags.length} tags in total`);
|
core.debug(`Found ${allTags.length} tags in total`);
|
||||||
|
|
||||||
if (version === 'latest' || !goreleaser.isPro(distribution)) {
|
|
||||||
return semver.maxSatisfying(allTags, version);
|
|
||||||
}
|
|
||||||
|
|
||||||
const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag));
|
const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag));
|
||||||
const cleanVersion: string = cleanTag(version);
|
const cleanVersion: string = cleanTag(version);
|
||||||
return semver.maxSatisfying(cleanTags, cleanVersion) + goreleaser.distribSuffix(distribution);
|
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 {
|
interface GitHubTag {
|
||||||
@@ -39,6 +66,7 @@ const getAllTags = async (distribution: string): Promise<Array<string>> => {
|
|||||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||||
const suffix: string = goreleaser.distribSuffix(distribution);
|
const suffix: string = goreleaser.distribSuffix(distribution);
|
||||||
const url = `https://goreleaser.com/static/releases${suffix}.json`;
|
const url = `https://goreleaser.com/static/releases${suffix}.json`;
|
||||||
|
core.debug(`Downloading ${url}`);
|
||||||
const getTags = http.getJson<Array<GitHubTag>>(url);
|
const getTags = http.getJson<Array<GitHubTag>>(url);
|
||||||
return getTags.then(response => {
|
return getTags.then(response => {
|
||||||
if (response.result == null) {
|
if (response.result == null) {
|
||||||
|
|||||||
+2
-5
@@ -8,11 +8,7 @@ import * as core from '@actions/core';
|
|||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
|
|
||||||
export async function install(distribution: string, version: string): Promise<string> {
|
export async function install(distribution: string, version: string): Promise<string> {
|
||||||
const release: github.GitHubRelease | null = await github.getRelease(distribution, version);
|
const release: github.GitHubRelease = await github.getRelease(distribution, version);
|
||||||
if (!release) {
|
|
||||||
throw new Error(`Cannot find GoReleaser ${version} release`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const filename = getFilename(distribution);
|
const filename = getFilename(distribution);
|
||||||
const downloadUrl = util.format(
|
const downloadUrl = util.format(
|
||||||
'https://github.com/goreleaser/%s/releases/download/%s/%s',
|
'https://github.com/goreleaser/%s/releases/download/%s/%s',
|
||||||
@@ -69,6 +65,7 @@ const getFilename = (distribution: string): string => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'arm': {
|
case 'arm': {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const arm_version = (process.config.variables as any).arm_version;
|
const arm_version = (process.config.variables as any).arm_version;
|
||||||
arch = arm_version ? 'armv' + arm_version : 'arm';
|
arch = arm_version ? 'armv' + arm_version : 'arm';
|
||||||
break;
|
break;
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let yamlfile: string | unknown;
|
let yamlfile: string | unknown;
|
||||||
const argv = yargs.parse(inputs.args);
|
const argv: {config: string} = yargs.parse(inputs.args) as never;
|
||||||
if (argv.config) {
|
if (argv.config) {
|
||||||
yamlfile = argv.config;
|
yamlfile = argv.config;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -14,17 +14,8 @@ builds:
|
|||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
goarch:
|
goarch:
|
||||||
- 386
|
- "386"
|
||||||
- amd64
|
- "amd64"
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
replacements:
|
|
||||||
386: i386
|
|
||||||
amd64: x86_64
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
|
|||||||
+2
-11
@@ -14,17 +14,8 @@ builds:
|
|||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
goarch:
|
goarch:
|
||||||
- 386
|
- "386"
|
||||||
- amd64
|
- "amd64"
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
replacements:
|
|
||||||
386: i386
|
|
||||||
amd64: x86_64
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
|
|||||||
+1
-2
@@ -1,13 +1,12 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"esModuleInterop": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false,
|
||||||
|
|||||||
Reference in New Issue
Block a user