Skip to content

Commit 336e299

Browse files
authored
feat: support nightly (#419)
* feat: support nightly Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * chore: nightly test Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * chore: typo Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
1 parent 3724734 commit 336e299

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,40 @@ jobs:
200200
name: Check dist
201201
run: |
202202
tree -nh ./test/_output
203+
204+
nightly:
205+
runs-on: ${{ matrix.os }}
206+
strategy:
207+
fail-fast: false
208+
matrix:
209+
os:
210+
- ubuntu-latest
211+
- macOS-latest
212+
- windows-latest
213+
distribution:
214+
- goreleaser-pro
215+
steps:
216+
-
217+
name: Checkout
218+
uses: actions/checkout@v3
219+
with:
220+
fetch-depth: 0
221+
-
222+
name: Set up Go
223+
uses: actions/setup-go@v4
224+
with:
225+
go-version: 1.18
226+
-
227+
name: GoReleaser
228+
uses: ./
229+
with:
230+
install-only: true
231+
distribution: ${{ matrix.distribution }}
232+
version: nightly
233+
-
234+
name: Check
235+
run: |
236+
goreleaser check -f ./test/.goreleaser.yml
237+
goreleaser --version
238+
goreleaser --version | grep pro-nightly
239+

__tests__/github.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ describe('getRelease', () => {
3232
expect(release?.tag_name).not.toEqual('');
3333
});
3434

35+
it('returns nightly GoReleaser Pro GitHub release', async () => {
36+
const release = await github.getRelease('goreleaser-pro', 'nightly');
37+
expect(release).not.toBeNull();
38+
expect(release?.tag_name).not.toEqual('');
39+
});
40+
3541
it('returns v0.182.0 GoReleaser Pro GitHub release', async () => {
3642
const release = await github.getRelease('goreleaser-pro', 'v0.182.0');
3743
expect(release).not.toBeNull();

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/github.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export const getRelease = async (distribution: string, version: string): Promise
1515
};
1616

1717
export const getReleaseTag = async (distribution: string, version: string): Promise<GitHubRelease> => {
18+
if (distribution === 'goreleaser-pro' && version === 'nightly') {
19+
return {tag_name: version};
20+
}
1821
const tag: string = (await resolveVersion(distribution, version)) || version;
1922
const suffix: string = goreleaser.distribSuffix(distribution);
2023
const url = `https://goreleaser.com/static/releases${suffix}.json`;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy