Skip to content

Commit

Permalink
fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ricsam committed Dec 12, 2024
1 parent dac2c6f commit e89a000
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun test
- run: bun run build
- run: |
echo '@ricsam:registry=https://registry.npmjs.org' >> .npmrc
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
echo '//registry.npmjs.org/:always-auth=true' >> .npmrc
- name: changeset publish
run: npx changeset publish --access=public --registry=https://registry.npmjs.org/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: bun test || true
- run: cat output.txt
# - run: bun run build
# - run: |
# echo '@ricsam:registry=https://registry.npmjs.org' >> .npmrc
# echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
# echo '//registry.npmjs.org/:always-auth=true' >> .npmrc
# - name: changeset publish
# run: npx changeset publish --access=public --registry=https://registry.npmjs.org/
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 12 additions & 4 deletions src/backends/s3/create-s3-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { S3Client, type S3ClientConfig } from '@aws-sdk/client-s3';
import * as stream from 'stream';
import { parseS3Uri } from './parse-s3-uri';

export function createS3Client(uri: string): S3Client {
Expand All @@ -25,15 +26,22 @@ export function createS3Client(uri: string): S3Client {
};
}

const file = Bun.file(process.cwd() + '/output.txt');
const w = file.writer();

config.endpoint =
parsed.endpoint ??
process.env.AWS_ENDPOINT_URL_S3 ??
process.env.AWS_ENDPOINT_URL;

config.logger = new console.Console({
stdout: process.stdout,
stderr: process.stderr,
const customLogger = new console.Console({
stderr: new stream.Writable(w),
stdout: new stream.Writable(w),
});
process.stdout.write(JSON.stringify(config, null, 2));

config.logger = customLogger;

customLogger.log('Creating S3 client with config:', config);

return new S3Client(config);
}

0 comments on commit e89a000

Please sign in to comment.