mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-29 20:58:28 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90a3faa9d0 | ||
|
|
0262998728 | ||
|
|
450d3a4bd2 | ||
|
|
25b92abef8 | ||
|
|
bc0ac76346 | ||
|
|
842e7ccd3e | ||
|
|
d28c98212f | ||
|
|
9ed2f89a66 | ||
|
|
cf63508052 | ||
|
|
f7623f3e71 | ||
|
|
006a7a4111 | ||
|
|
e4066e695c | ||
|
|
22f558e822 | ||
|
|
6e33108d10 | ||
|
|
7ca645047c | ||
|
|
d33b6f6aea | ||
|
|
85d0b9d4cd | ||
|
|
286f3b13b1 | ||
|
|
beac410314 | ||
|
|
18bbabc70c |
+12
-10
@@ -28,7 +28,8 @@ jobs:
|
|||||||
- windows-latest
|
- windows-latest
|
||||||
version:
|
version:
|
||||||
- latest
|
- latest
|
||||||
- '~> 1.15'
|
- '~> 2.6'
|
||||||
|
- '~> 1.26'
|
||||||
distribution:
|
distribution:
|
||||||
- goreleaser
|
- goreleaser
|
||||||
- goreleaser-pro
|
- goreleaser-pro
|
||||||
@@ -48,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
|
||||||
@@ -59,7 +60,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
args: release --skip-publish --clean --snapshot
|
args: release --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
|
|
||||||
install-only:
|
install-only:
|
||||||
@@ -69,7 +70,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- latest
|
- latest
|
||||||
- '~> 0.166'
|
- '~> 2.6'
|
||||||
|
- '~> 1.26'
|
||||||
distribution:
|
distribution:
|
||||||
- goreleaser
|
- goreleaser
|
||||||
- goreleaser-pro
|
- goreleaser-pro
|
||||||
@@ -96,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 }}
|
||||||
@@ -131,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 }}
|
||||||
@@ -140,7 +142,7 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: -f .goreleaser-signing.yml release --skip-publish --clean --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 }}
|
||||||
@@ -162,13 +164,13 @@ jobs:
|
|||||||
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 --clean --snapshot
|
args: release --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: Upload assets
|
name: Upload assets
|
||||||
@@ -194,7 +196,7 @@ jobs:
|
|||||||
name: GoReleaser
|
name: GoReleaser
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
args: release --config .goreleaser-dist.yml --skip-publish --clean --snapshot
|
args: release --config .goreleaser-dist.yml --skip=publish --clean --snapshot
|
||||||
workdir: ./test
|
workdir: ./test
|
||||||
-
|
-
|
||||||
name: Check dist
|
name: Check dist
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
file: ./coverage/clover.xml
|
||||||
|
|||||||
@@ -40,6 +40,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Validate
|
name: Validate
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ ___
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for
|
GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for
|
||||||
more information about how to customize what GoReleaser do.
|
more information about how to customize what GoReleaser does.
|
||||||
|
|
||||||
[goreleaser]: https://goreleaser.com/
|
[goreleaser]: https://goreleaser.com/
|
||||||
[gdocs]: https://goreleaser.com/customization
|
[gdocs]: https://goreleaser.com/customization
|
||||||
@@ -59,15 +59,15 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
# either 'goreleaser' (default) or 'goreleaser-pro'
|
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
# 'latest', 'nightly', or a semver
|
# 'latest', 'nightly', or a semver
|
||||||
version: '~> v1'
|
version: '~> v2'
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -93,10 +93,10 @@ Or with a condition on GoReleaser step:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
version: '~> v1'
|
version: '~> v2'
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -119,9 +119,9 @@ the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action
|
|||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: '~> v1'
|
version: '~> v2'
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -139,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@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: '~> v1'
|
version: '~> v2'
|
||||||
args: release --clean
|
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/*
|
||||||
@@ -165,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@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
-
|
-
|
||||||
@@ -182,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 | `~> v1` | 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 |
|
||||||
@@ -219,9 +219,9 @@ secret named `GH_PAT`, the step will look like this:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
version: '~> v1'
|
version: '~> v2'
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||||
|
|||||||
@@ -44,6 +44,18 @@ describe('getRelease', () => {
|
|||||||
expect(release?.tag_name).not.toEqual('');
|
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 () => {
|
it('returns nightly GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser', 'nightly');
|
const release = await github.getRelease('goreleaser', 'nightly');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
@@ -68,9 +80,15 @@ describe('getRelease', () => {
|
|||||||
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 () => {
|
it('unknown GoReleaser Pro release', async () => {
|
||||||
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow(
|
await expect(github.getRelease('goreleaser-pro', 'foo')).rejects.toThrow(
|
||||||
new Error('Cannot find GoReleaser release foo-pro in https://goreleaser.com/static/releases-pro.json')
|
new Error('Cannot find GoReleaser release foo in https://goreleaser.com/static/releases-pro.json')
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,6 +28,16 @@ describe('install', () => {
|
|||||||
expect(fs.existsSync(bin)).toBe(true);
|
expect(fs.existsSync(bin)).toBe(true);
|
||||||
}, 100000);
|
}, 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);
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'GoReleaser version'
|
description: 'GoReleaser version'
|
||||||
default: '~> v1'
|
default: '~> v2'
|
||||||
required: false
|
required: false
|
||||||
args:
|
args:
|
||||||
description: 'Arguments to pass to GoReleaser'
|
description: 'Arguments to pass to GoReleaser'
|
||||||
|
|||||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
-13
@@ -379,19 +379,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
uuid
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2010-2020 Robert Kieffer and other 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
|
wrap-ansi
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|||||||
+4
-4
@@ -26,12 +26,12 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "yarn@3.6.3",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/http-client": "^2.2.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",
|
||||||
"semver": "^7.6.2",
|
"semver": "^7.7.1",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+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') || '~> v1',
|
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')
|
||||||
|
|||||||
+14
-8
@@ -8,10 +8,9 @@ export interface GitHubRelease {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
export const getRelease = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||||
// TODO: change this to ~> v2 on a future major, once goreleaser v2 is out
|
|
||||||
if (version === 'latest') {
|
if (version === 'latest') {
|
||||||
core.warning("You are using 'latest' as default version. Will lock to '~> v1'.");
|
core.warning("You are using 'latest' as default version. Will lock to '~> v2'.");
|
||||||
return getReleaseTag(distribution, '~> v1');
|
return getReleaseTag(distribution, '~> v2');
|
||||||
}
|
}
|
||||||
return getReleaseTag(distribution, version);
|
return getReleaseTag(distribution, version);
|
||||||
};
|
};
|
||||||
@@ -28,16 +27,14 @@ export const getReleaseTag = async (distribution: string, version: string): Prom
|
|||||||
const body = await resp.readBody();
|
const body = await resp.readBody();
|
||||||
const statusCode = resp.message.statusCode || 500;
|
const statusCode = resp.message.statusCode || 500;
|
||||||
if (statusCode >= 400) {
|
if (statusCode >= 400) {
|
||||||
throw new Error(
|
throw new Error(`Failed to get GoReleaser release ${version} from ${url} with status code ${statusCode}: ${body}`);
|
||||||
`Failed to get GoReleaser release ${version}${suffix} from ${url} with status code ${statusCode}: ${body}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
const releases = <Array<GitHubRelease>>JSON.parse(body);
|
const releases = <Array<GitHubRelease>>JSON.parse(body);
|
||||||
const res = releases.filter(r => r.tag_name === tag).shift();
|
const res = releases.filter(r => r.tag_name === tag).shift();
|
||||||
if (res) {
|
if (res) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
throw new Error(`Cannot find GoReleaser release ${version}${suffix} in ${url}`);
|
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> => {
|
||||||
@@ -49,7 +46,16 @@ const resolveVersion = async (distribution: string, version: string): Promise<st
|
|||||||
|
|
||||||
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 {
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ builds:
|
|||||||
- "386"
|
- "386"
|
||||||
- "amd64"
|
- "amd64"
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,5 @@ builds:
|
|||||||
- "386"
|
- "386"
|
||||||
- "amd64"
|
- "amd64"
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
|
|||||||
@@ -12,23 +12,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@actions/core@npm:^1.10.1":
|
"@actions/core@npm:^1.11.1":
|
||||||
version: 1.10.1
|
version: 1.11.1
|
||||||
resolution: "@actions/core@npm:1.10.1"
|
resolution: "@actions/core@npm:1.11.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@actions/exec": ^1.1.1
|
||||||
"@actions/http-client": ^2.0.1
|
"@actions/http-client": ^2.0.1
|
||||||
uuid: ^8.3.2
|
checksum: 9ac7a3e0b478bfefd862dcb4ddaa1d8c3f9076bb1931d3d280918d1749e7783480c6a009c1b009c8bf5093e2d77d9f4e023d70416145bf246f0071736d4ef839
|
||||||
checksum: 96524c2725e70e3c3176b4e4d93a1358a86f3c5ca777db9a2f65eadfa672f00877db359bf60fffc416c33838ffb4743db93bcc5bf53e76199dd28bf7f7ff8e80
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@actions/core@npm:^1.2.6":
|
|
||||||
version: 1.10.0
|
|
||||||
resolution: "@actions/core@npm:1.10.0"
|
|
||||||
dependencies:
|
|
||||||
"@actions/http-client": ^2.0.1
|
|
||||||
uuid: ^8.3.2
|
|
||||||
checksum: 0a75621e007ab20d887434cdd165f0b9036f14c22252a2faed33543d8b9d04ec95d823e69ca636a25245574e4585d73e1e9e47a845339553c664f9f2c9614669
|
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -50,13 +40,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@actions/http-client@npm:^2.2.1":
|
"@actions/http-client@npm:^2.2.3":
|
||||||
version: 2.2.1
|
version: 2.2.3
|
||||||
resolution: "@actions/http-client@npm:2.2.1"
|
resolution: "@actions/http-client@npm:2.2.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
tunnel: ^0.0.6
|
tunnel: ^0.0.6
|
||||||
undici: ^5.25.4
|
undici: ^5.25.4
|
||||||
checksum: c51c003cd697289136c0e81c0f9b8e57a9bb1a038dc7c9a91a71c02f4ae5e27ef7d3e305aefa7c815604049209d114c06e9991a5c5eaa055508519329267f962
|
checksum: 5d395df575d30ae599efa10dd715e72944b015e753db61f0a823f737acbb0e99743d4a9f25e812b18ec8cc34f86c73565d075c449e01ffa891577b6595212dde
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -67,17 +57,16 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@actions/tool-cache@npm:^2.0.1":
|
"@actions/tool-cache@npm:^2.0.2":
|
||||||
version: 2.0.1
|
version: 2.0.2
|
||||||
resolution: "@actions/tool-cache@npm:2.0.1"
|
resolution: "@actions/tool-cache@npm:2.0.2"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.2.6
|
"@actions/core": ^1.11.1
|
||||||
"@actions/exec": ^1.0.0
|
"@actions/exec": ^1.0.0
|
||||||
"@actions/http-client": ^2.0.1
|
"@actions/http-client": ^2.0.1
|
||||||
"@actions/io": ^1.1.1
|
"@actions/io": ^1.1.1
|
||||||
semver: ^6.1.0
|
semver: ^6.1.0
|
||||||
uuid: ^3.3.2
|
checksum: c2bab4297be752bdda9dd61f8159a201ad0d37d026134b960f1edcc9418a80387f44d1f24a070fe992c44dcfc28a152f70600e76669bb0578132789a6f37a596
|
||||||
checksum: 33f6393b9b163e4af2b9759e8d37cda4f018f10ddda3643355bb8a9f92d732e5bdff089cf8036b46d181e1ef2b3210b895b2f746fdf54487afe88f1d340aa9e1
|
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -1992,12 +1981,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"braces@npm:^3.0.2":
|
"braces@npm:^3.0.3":
|
||||||
version: 3.0.2
|
version: 3.0.3
|
||||||
resolution: "braces@npm:3.0.2"
|
resolution: "braces@npm:3.0.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
fill-range: ^7.0.1
|
fill-range: ^7.1.1
|
||||||
checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459
|
checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -2285,13 +2274,13 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
|
"cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
|
||||||
version: 7.0.3
|
version: 7.0.6
|
||||||
resolution: "cross-spawn@npm:7.0.3"
|
resolution: "cross-spawn@npm:7.0.6"
|
||||||
dependencies:
|
dependencies:
|
||||||
path-key: ^3.1.0
|
path-key: ^3.1.0
|
||||||
shebang-command: ^2.0.0
|
shebang-command: ^2.0.0
|
||||||
which: ^2.0.1
|
which: ^2.0.1
|
||||||
checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52
|
checksum: 8d306efacaf6f3f60e0224c287664093fa9185680b2d195852ba9a863f85d02dcc737094c6e512175f8ee0161f9b87c73c6826034c2422e39de7d6569cf4503b
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -2878,12 +2867,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"fill-range@npm:^7.0.1":
|
"fill-range@npm:^7.1.1":
|
||||||
version: 7.0.1
|
version: 7.1.1
|
||||||
resolution: "fill-range@npm:7.0.1"
|
resolution: "fill-range@npm:7.1.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
to-regex-range: ^5.0.1
|
to-regex-range: ^5.0.1
|
||||||
checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917
|
checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -3089,10 +3078,10 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "goreleaser-action@workspace:."
|
resolution: "goreleaser-action@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.10.1
|
"@actions/core": ^1.11.1
|
||||||
"@actions/exec": ^1.1.1
|
"@actions/exec": ^1.1.1
|
||||||
"@actions/http-client": ^2.2.1
|
"@actions/http-client": ^2.2.3
|
||||||
"@actions/tool-cache": ^2.0.1
|
"@actions/tool-cache": ^2.0.2
|
||||||
"@types/node": ^20.6.0
|
"@types/node": ^20.6.0
|
||||||
"@typescript-eslint/eslint-plugin": ^6.6.0
|
"@typescript-eslint/eslint-plugin": ^6.6.0
|
||||||
"@typescript-eslint/parser": ^6.6.0
|
"@typescript-eslint/parser": ^6.6.0
|
||||||
@@ -3105,7 +3094,7 @@ __metadata:
|
|||||||
jest: ^29.6.4
|
jest: ^29.6.4
|
||||||
js-yaml: ^4.1.0
|
js-yaml: ^4.1.0
|
||||||
prettier: ^3.0.3
|
prettier: ^3.0.3
|
||||||
semver: ^7.6.2
|
semver: ^7.7.1
|
||||||
tmp: ^0.2.1
|
tmp: ^0.2.1
|
||||||
ts-jest: ^29.1.1
|
ts-jest: ^29.1.1
|
||||||
ts-node: ^10.9.1
|
ts-node: ^10.9.1
|
||||||
@@ -4186,12 +4175,12 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"micromatch@npm:^4.0.4":
|
"micromatch@npm:^4.0.4":
|
||||||
version: 4.0.5
|
version: 4.0.8
|
||||||
resolution: "micromatch@npm:4.0.5"
|
resolution: "micromatch@npm:4.0.8"
|
||||||
dependencies:
|
dependencies:
|
||||||
braces: ^3.0.2
|
braces: ^3.0.3
|
||||||
picomatch: ^2.3.1
|
picomatch: ^2.3.1
|
||||||
checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc
|
checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -4895,12 +4884,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"semver@npm:^7.6.2":
|
"semver@npm:^7.7.1":
|
||||||
version: 7.6.2
|
version: 7.7.1
|
||||||
resolution: "semver@npm:7.6.2"
|
resolution: "semver@npm:7.7.1"
|
||||||
bin:
|
bin:
|
||||||
semver: bin/semver.js
|
semver: bin/semver.js
|
||||||
checksum: 40f6a95101e8d854357a644da1b8dd9d93ce786d5c6a77227bc69dbb17bea83d0d1d1d7c4cd5920a6df909f48e8bd8a5909869535007f90278289f2451d0292d
|
checksum: 586b825d36874007c9382d9e1ad8f93888d8670040add24a28e06a910aeebd673a2eb9e3bf169c6679d9245e66efb9057e0852e70d9daa6c27372aab1dda7104
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -5442,24 +5431,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"uuid@npm:^3.3.2":
|
|
||||||
version: 3.4.0
|
|
||||||
resolution: "uuid@npm:3.4.0"
|
|
||||||
bin:
|
|
||||||
uuid: ./bin/uuid
|
|
||||||
checksum: 58de2feed61c59060b40f8203c0e4ed7fd6f99d42534a499f1741218a1dd0c129f4aa1de797bcf822c8ea5da7e4137aa3673431a96dae729047f7aca7b27866f
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"uuid@npm:^8.3.2":
|
|
||||||
version: 8.3.2
|
|
||||||
resolution: "uuid@npm:8.3.2"
|
|
||||||
bin:
|
|
||||||
uuid: dist/bin/uuid
|
|
||||||
checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"v8-compile-cache-lib@npm:^3.0.1":
|
"v8-compile-cache-lib@npm:^3.0.1":
|
||||||
version: 3.0.1
|
version: 3.0.1
|
||||||
resolution: "v8-compile-cache-lib@npm:3.0.1"
|
resolution: "v8-compile-cache-lib@npm:3.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user