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>
This commit is contained in:
parent
37247345b4
commit
336e29918d
|
@ -200,3 +200,40 @@ jobs:
|
||||||
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
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
-
|
||||||
|
name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
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 pro-nightly
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,12 @@ describe('getRelease', () => {
|
||||||
expect(release?.tag_name).not.toEqual('');
|
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 () => {
|
it('returns v0.182.0 GoReleaser Pro GitHub release', async () => {
|
||||||
const release = await github.getRelease('goreleaser-pro', 'v0.182.0');
|
const release = await github.getRelease('goreleaser-pro', 'v0.182.0');
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -15,6 +15,9 @@ export const getRelease = async (distribution: string, version: string): Promise
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getReleaseTag = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
export const getReleaseTag = async (distribution: string, version: string): Promise<GitHubRelease> => {
|
||||||
|
if (distribution === 'goreleaser-pro' && version === 'nightly') {
|
||||||
|
return {tag_name: version};
|
||||||
|
}
|
||||||
const tag: string = (await resolveVersion(distribution, version)) || version;
|
const tag: string = (await resolveVersion(distribution, version)) || version;
|
||||||
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`;
|
||||||
|
|
Loading…
Reference in New Issue