Compare commits

..
6 Commits
Author SHA1 Message Date
Carlos Alexandro Becker 14c857869c ci: update workflow and .goreleaser.yml
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-06-04 21:55:22 -03:00
Carlos Alexandro Becker 216295ec78 docs: update 2024-06-03 22:56:43 -03:00
Carlos Alexandro Becker f86c9c37ec docs: update 2024-06-03 22:56:04 -03:00
Carlos Alexandro Becker 9b0b610e34 gen
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-28 09:50:41 -03:00
Carlos Alexandro Becker 2d86541f03 fix: more changes
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-26 14:58:02 -03:00
Carlos Alexandro Becker fea4ca2b14 feat!: use "~> v2" as default
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-26 14:39:26 -03:00
14 changed files with 82 additions and 69 deletions
+2 -4
View File
@@ -28,8 +28,7 @@ jobs:
- windows-latest
version:
- latest
- '~> 2.6'
- '~> 1.26'
- '~> 1.15'
distribution:
- goreleaser
- goreleaser-pro
@@ -70,8 +69,7 @@ jobs:
matrix:
version:
- latest
- '~> 2.6'
- '~> 1.26'
- '~> 0.166'
distribution:
- goreleaser
- goreleaser-pro
+2 -2
View File
@@ -22,11 +22,11 @@ jobs:
fetch-depth: 0
-
name: Test
uses: docker/bake-action@v6
uses: docker/bake-action@v4
with:
targets: test
-
name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v4
with:
file: ./coverage/clover.xml
+1 -1
View File
@@ -40,6 +40,6 @@ jobs:
uses: actions/checkout@v4
-
name: Validate
uses: docker/bake-action@v5
uses: docker/bake-action@v4
with:
targets: ${{ matrix.target }}
+3 -3
View File
@@ -31,7 +31,7 @@ ___
## Usage
GoReleaser Action runs [goreleaser][], please follow its [docs][gdocs] for
more information about how to customize what GoReleaser does.
more information about how to customize what GoReleaser do.
[goreleaser]: https://goreleaser.com/
[gdocs]: https://goreleaser.com/customization
@@ -139,7 +139,7 @@ signs:
### Upload artifacts
For some events like pull request or schedule you might want to store the artifacts somewhere for testing
purposes. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
purpose. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
```yaml
-
@@ -153,7 +153,7 @@ purposes. You can do that with the [actions/upload-artifact](https://github.com/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload assets
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: myapp
path: myfolder/dist/*
+1 -7
View File
@@ -80,15 +80,9 @@ describe('getRelease', () => {
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')
new Error('Cannot find GoReleaser release foo-pro in https://goreleaser.com/static/releases-pro.json')
);
});
});
Generated Vendored
+3 -3
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+13
View File
@@ -379,6 +379,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
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
MIT
MIT License
+4 -4
View File
@@ -26,12 +26,12 @@
"license": "MIT",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.2.3",
"@actions/tool-cache": "^2.0.2",
"@actions/http-client": "^2.2.1",
"@actions/tool-cache": "^2.0.1",
"js-yaml": "^4.1.0",
"semver": "^7.7.1",
"semver": "^7.6.2",
"yargs": "^17.7.2"
},
"devDependencies": {
+5 -12
View File
@@ -27,14 +27,16 @@ export const getReleaseTag = async (distribution: string, version: string): Prom
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}`);
throw new Error(
`Failed to get GoReleaser release ${version}${suffix} 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}`);
throw new Error(`Cannot find GoReleaser release ${version}${suffix} in ${url}`);
};
const resolveVersion = async (distribution: string, version: string): Promise<string | null> => {
@@ -46,16 +48,7 @@ const resolveVersion = async (distribution: string, version: string): Promise<st
const cleanTags: Array<string> = allTags.map(tag => cleanTag(tag));
const cleanVersion: string = cleanTag(version);
if (!semver.valid(cleanVersion) && !semver.validRange(cleanVersion)) {
// if the given version is invalid, return whatever we got.
return version;
}
const v = semver.maxSatisfying(cleanTags, cleanVersion);
if (semver.lt(v, '2.7.0')) {
// if its a version older than 2.7.0, append the suffix.
return v + goreleaser.distribSuffix(distribution);
}
return v;
return semver.maxSatisfying(cleanTags, cleanVersion) + goreleaser.distribSuffix(distribution);
};
interface GitHubTag {
+1
View File
@@ -1,3 +1,4 @@
version: 2
env:
- GO111MODULE=on
+7
View File
@@ -1,3 +1,4 @@
version: 2
env:
- GO111MODULE=on
@@ -17,6 +18,12 @@ builds:
- "386"
- "amd64"
archives:
-
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
+7
View File
@@ -1,3 +1,4 @@
version: 2
env:
- GO111MODULE=on
@@ -17,5 +18,11 @@ builds:
- "386"
- "amd64"
archives:
-
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
+32 -32
View File
@@ -12,13 +12,13 @@ __metadata:
languageName: node
linkType: hard
"@actions/core@npm:^1.11.1":
version: 1.11.1
resolution: "@actions/core@npm:1.11.1"
"@actions/core@npm:^1.10.1":
version: 1.10.1
resolution: "@actions/core@npm:1.10.1"
dependencies:
"@actions/exec": ^1.1.1
"@actions/http-client": ^2.0.1
checksum: 9ac7a3e0b478bfefd862dcb4ddaa1d8c3f9076bb1931d3d280918d1749e7783480c6a009c1b009c8bf5093e2d77d9f4e023d70416145bf246f0071736d4ef839
uuid: ^8.3.2
checksum: 96524c2725e70e3c3176b4e4d93a1358a86f3c5ca777db9a2f65eadfa672f00877db359bf60fffc416c33838ffb4743db93bcc5bf53e76199dd28bf7f7ff8e80
languageName: node
linkType: hard
@@ -50,13 +50,13 @@ __metadata:
languageName: node
linkType: hard
"@actions/http-client@npm:^2.2.3":
version: 2.2.3
resolution: "@actions/http-client@npm:2.2.3"
"@actions/http-client@npm:^2.2.1":
version: 2.2.1
resolution: "@actions/http-client@npm:2.2.1"
dependencies:
tunnel: ^0.0.6
undici: ^5.25.4
checksum: 5d395df575d30ae599efa10dd715e72944b015e753db61f0a823f737acbb0e99743d4a9f25e812b18ec8cc34f86c73565d075c449e01ffa891577b6595212dde
checksum: c51c003cd697289136c0e81c0f9b8e57a9bb1a038dc7c9a91a71c02f4ae5e27ef7d3e305aefa7c815604049209d114c06e9991a5c5eaa055508519329267f962
languageName: node
linkType: hard
@@ -1992,12 +1992,12 @@ __metadata:
languageName: node
linkType: hard
"braces@npm:^3.0.3":
version: 3.0.3
resolution: "braces@npm:3.0.3"
"braces@npm:^3.0.2":
version: 3.0.2
resolution: "braces@npm:3.0.2"
dependencies:
fill-range: ^7.1.1
checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69
fill-range: ^7.0.1
checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459
languageName: node
linkType: hard
@@ -2285,13 +2285,13 @@ __metadata:
linkType: hard
"cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
version: 7.0.6
resolution: "cross-spawn@npm:7.0.6"
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
dependencies:
path-key: ^3.1.0
shebang-command: ^2.0.0
which: ^2.0.1
checksum: 8d306efacaf6f3f60e0224c287664093fa9185680b2d195852ba9a863f85d02dcc737094c6e512175f8ee0161f9b87c73c6826034c2422e39de7d6569cf4503b
checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52
languageName: node
linkType: hard
@@ -2878,12 +2878,12 @@ __metadata:
languageName: node
linkType: hard
"fill-range@npm:^7.1.1":
version: 7.1.1
resolution: "fill-range@npm:7.1.1"
"fill-range@npm:^7.0.1":
version: 7.0.1
resolution: "fill-range@npm:7.0.1"
dependencies:
to-regex-range: ^5.0.1
checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798
checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917
languageName: node
linkType: hard
@@ -3089,9 +3089,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "goreleaser-action@workspace:."
dependencies:
"@actions/core": ^1.11.1
"@actions/core": ^1.10.1
"@actions/exec": ^1.1.1
"@actions/http-client": ^2.2.3
"@actions/http-client": ^2.2.1
"@actions/tool-cache": ^2.0.1
"@types/node": ^20.6.0
"@typescript-eslint/eslint-plugin": ^6.6.0
@@ -3105,7 +3105,7 @@ __metadata:
jest: ^29.6.4
js-yaml: ^4.1.0
prettier: ^3.0.3
semver: ^7.6.3
semver: ^7.6.2
tmp: ^0.2.1
ts-jest: ^29.1.1
ts-node: ^10.9.1
@@ -4186,12 +4186,12 @@ __metadata:
linkType: hard
"micromatch@npm:^4.0.4":
version: 4.0.8
resolution: "micromatch@npm:4.0.8"
version: 4.0.5
resolution: "micromatch@npm:4.0.5"
dependencies:
braces: ^3.0.3
braces: ^3.0.2
picomatch: ^2.3.1
checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966
checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc
languageName: node
linkType: hard
@@ -4895,12 +4895,12 @@ __metadata:
languageName: node
linkType: hard
"semver@npm:^7.6.3":
version: 7.6.3
resolution: "semver@npm:7.6.3"
"semver@npm:^7.6.2":
version: 7.6.2
resolution: "semver@npm:7.6.2"
bin:
semver: bin/semver.js
checksum: 4110ec5d015c9438f322257b1c51fe30276e5f766a3f64c09edd1d7ea7118ecbc3f379f3b69032bacf13116dc7abc4ad8ce0d7e2bd642e26b0d271b56b61a7d8
checksum: 40f6a95101e8d854357a644da1b8dd9d93ce786d5c6a77227bc69dbb17bea83d0d1d1d7c4cd5920a6df909f48e8bd8a5909869535007f90278289f2451d0292d
languageName: node
linkType: hard