Skip to content

Bump @aws-sdk/client-s3 from 3.1011.0 to 3.1014.0 (#7) #10

Bump @aws-sdk/client-s3 from 3.1011.0 to 3.1014.0 (#7)

Bump @aws-sdk/client-s3 from 3.1011.0 to 3.1014.0 (#7) #10

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: publish
cancel-in-progress: false
jobs:
prepare_release_pr:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
registry-url: https://registry.npmjs.org
- name: Upgrade npm for trusted publishing
run: npm install --global npm@^11.5.1
- name: Install dependencies
run: npm ci
- name: Run checks
run: npm run check
- name: Create or update release PR
uses: changesets/action@v1
with:
commit: "chore: version packages"
title: "chore: version packages"
version: npm run version-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
detect_publish:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: prepare_release_pr
permissions:
contents: read
outputs:
should_publish: ${{ steps.detect.outputs.should_publish }}
local_version: ${{ steps.detect.outputs.local_version }}
registry_version: ${{ steps.detect.outputs.registry_version }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Detect pending npm publish
id: detect
shell: bash
run: |
node --input-type=module <<'EOF'
import { readFileSync, appendFileSync } from "node:fs";
const packageJson = JSON.parse(
readFileSync("packages/blr/package.json", "utf8"),
);
const packageName = packageJson.name;
const localVersion = packageJson.version;
let registryVersion = "";
try {
const response = await fetch(
`https://registry.npmjs.org/${encodeURIComponent(packageName)}/latest`,
);
if (response.ok) {
const payload = await response.json();
registryVersion = String(payload.version ?? "");
} else if (response.status !== 404) {
throw new Error(
`npm registry lookup failed with ${response.status} ${response.statusText}`,
);
}
} catch (error) {
console.error(
`[release] Failed to determine npm registry version: ${error instanceof Error ? error.message : String(error)}`,
);
process.exit(1);
}
const shouldPublish = localVersion !== registryVersion;
console.log(
`[release] local=${localVersion} registry=${registryVersion || "<missing>"} should_publish=${shouldPublish}`,
);
const outputPath = process.env.GITHUB_OUTPUT;
if (!outputPath) {
throw new Error("GITHUB_OUTPUT is not set.");
}
appendFileSync(outputPath, `local_version=${localVersion}\n`);
appendFileSync(outputPath, `registry_version=${registryVersion}\n`);
appendFileSync(outputPath, `should_publish=${shouldPublish}\n`);
EOF
publish_package:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: detect_publish
if: needs.detect_publish.outputs.should_publish == 'true'
environment: release
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
registry-url: https://registry.npmjs.org
- name: Upgrade npm for trusted publishing
run: npm install --global npm@^11.5.1
- name: Install dependencies
run: npm ci
- name: Run checks
run: npm run check
- name: Publish package
run: npm run release
env:
NPM_CONFIG_PROVENANCE: true