Skip to content

Commit

Permalink
feat: support oss nightlies (#424)
Browse files Browse the repository at this point in the history
* feat: support oss nightlies

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* fix: test

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Aug 9, 2023
1 parent 920a7cb commit c7c9447
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -212,6 +212,7 @@ jobs:
- windows-latest
distribution:
- goreleaser-pro
- goreleaser
steps:
-
name: Checkout
Expand All @@ -235,5 +236,5 @@ jobs:
run: |
goreleaser check -f ./test/.goreleaser.yml
goreleaser --version
goreleaser --version | grep pro-nightly
goreleaser --version | grep nightly
6 changes: 6 additions & 0 deletions __tests__/github.test.ts
Expand Up @@ -32,6 +32,12 @@ describe('getRelease', () => {
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();
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/github.ts
Expand Up @@ -15,7 +15,7 @@ export const getRelease = async (distribution: string, version: string): Promise
};

export const getReleaseTag = async (distribution: string, version: string): Promise<GitHubRelease> => {
if (distribution === 'goreleaser-pro' && version === 'nightly') {
if (version === 'nightly') {
return {tag_name: version};
}
const tag: string = (await resolveVersion(distribution, version)) || version;
Expand Down

0 comments on commit c7c9447

Please sign in to comment.