Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dist resolution from config file #369

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,27 @@ jobs:
workdir: ./test
env:
GORELEASER_CURRENT_TAG: v99.99.99

dist:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: GoReleaser
uses: ./
with:
args: release --config .goreleaser-dist.yml --skip-publish --rm-dist
workdir: ./test
-
name: Check dist
run: |
tree -nh ./test/_output
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/goreleaser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const getFilename = (distribution: string): string => {
};

export async function getDistPath(yamlfile: string): Promise<string> {
const cfg = yaml.load(yamlfile);
const cfg = yaml.load(fs.readFileSync(yamlfile, 'utf8'));
return cfg.dist || 'dist';
}

Expand Down
18 changes: 18 additions & 0 deletions test/.goreleaser-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
- GO111MODULE=on

before:
hooks:
- go mod download

builds:
-
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
goarch:
- amd64

dist: _output