Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ jobs:
needs: build
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -217,6 +216,11 @@ jobs:
- run: npm test
working-directory: typescript

- run: npm run publish
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
working-directory: typescript
# Deliberately not running `npm run publish` here (upstream's tag-triggered
# public npm release step). This fork never publishes to public npmjs.org
# under any name -- internal releases go through publish-codeartifact.yml
# instead, to DrumWave's private CodeArtifact registry. Left disabled rather
# than adapted to publish.ts's dist/dbmate layout: `generate.ts` now writes
# dist/@drumwave/dbmate(-<platform>), so publish.ts's hardcoded dist/dbmate
# / dist/@dbmate paths no longer exist, and readdir("dist/@dbmate") would
# throw if this step ever ran (e.g. a stray `v*` tag pushed by accident).
169 changes: 169 additions & 0 deletions .github/workflows/publish-codeartifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Publishes this fork's dbmate npm packages to DrumWave's private CodeArtifact
# repository instead of the public npm registry. Mirrors the OIDC -> codeartifact
# login -> npm publish pattern marketplace.monorepo's own sdk-publish.yaml uses
# for @drumwave/mp-internal-sdk / @drumwave/mp-sdk.
#
# Published under the @drumwave scope (@drumwave/dbmate, @drumwave/dbmate-<platform>)
# rather than the upstream public names (dbmate, @dbmate/<platform>). Publishing
# under the same names CodeArtifact already proxies from npmjs.org would mean
# permanently relaxing origin-control on common-library-npm -- a repo shared with
# every other internal package -- and with upstream still reachable, a real dbmate
# release could silently take precedence over this patched build later (prerelease
# versions don't win an ordinary semver range against it). Scoping to @drumwave
# sidesteps both: the name was never fetched from upstream, so no origin-control
# change is needed at all.
#
# Trigger: manual only, via workflow_dispatch. Kept separate from ci.yml's
# `v*` tag trigger so this never collides with (or accidentally piggybacks on)
# the upstream public-npm release flow. Run it after bumping
# pkg/dbmate/version.go to a version string that doesn't exist upstream, e.g.
# "2.35.1-drumwave.1".
name: Publish to CodeArtifact

on:
workflow_dispatch: {}

jobs:
build:
Comment thread
jyothsna-m7 marked this conversation as resolved.
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: linux
image: ubuntu-latest
arch: 386
setup: sudo apt-get update && sudo apt-get install -qq gcc-i686-linux-gnu
env:
CC: i686-linux-gnu-gcc
CXX: i686-linux-gnu-g++
- os: linux
image: ubuntu-latest
arch: amd64
env: {}
- os: linux
image: ubuntu-latest
arch: arm
setup: sudo apt-get update && sudo apt-get install -qq gcc-arm-linux-gnueabi
env:
CC: arm-linux-gnueabi-gcc
CXX: arm-linux-gnueabi-g++
GOARM: 6
- os: linux
image: ubuntu-latest
arch: arm64
setup: sudo apt-get update && sudo apt-get install -qq gcc-aarch64-linux-gnu
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
- os: macos
image: macos-latest
arch: amd64
env: {}
- os: macos
image: macos-latest
arch: arm64
env: {}
- os: windows
image: windows-latest
arch: amd64
setup: choco install sqlite
env: {}
name: Build (${{ matrix.os }}/${{ matrix.arch }})
runs-on: ${{ matrix.image }}
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- name: Setup environment
run: ${{ matrix.setup }}
- run: go mod download
- run: make build ls
env:
GOARCH: ${{ matrix.arch }}
OUTPUT: dbmate-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: dbmate-${{ matrix.os }}-${{ matrix.arch }}
path: dist/dbmate-*

publish:
name: Publish npm packages to CodeArtifact
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write # AWS OIDC
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- run: corepack enable
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 20
cache: npm
cache-dependency-path: typescript/package-lock.json

- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: dist

- run: npm ci
working-directory: typescript
- run: npm run generate
working-directory: typescript
- run: npm test
working-directory: typescript

# Same role/domain/repository sdk-publish.yaml uses in marketplace.monorepo.
# Confirmed with the SRE team directly: the role's trust policy already
# accepts any reddrummer/* repo (org-wide wildcard subject) and it has
# AWSCodeArtifactAdminAccess attached, so no IAM changes were needed here.
Comment thread
jyothsna-m7 marked this conversation as resolved.
#
# Known tradeoff, accepted for now (see PR #1 review): this is a shared,
# org-wide-trusted role with admin-level CodeArtifact access, so any
# reddrummer/* repo's CI can already modify anything in common-library-npm,
# not just this repo's packages. marketplace.monorepo's sdk-publish.yaml
# depends on this same shared role, so narrowing its trust to just
# reddrummer/dbmate isn't an option here -- a properly-scoped fix would
# mean giving dbmate its own dedicated OIDC role instead (the per-repo
# actions-role pattern offers-service/pricing-service/dw-notify already
# use), which is a separate Terraform PR against sre.infrastructure.
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6
with:
role-to-assume: arn:aws:iam::127266044500:role/reddrummer-github-actions-runner
aws-region: us-east-1
role-session-name: GitHubActions-CodeArtifact-Publish

- name: Login npm to CodeArtifact
run: |
aws codeartifact login --tool npm \
--domain drumwave-prod \
--domain-owner 127266044500 \
--repository common-library-npm \
--region us-east-1

# publish.ts hardcodes --provenance (npm's OIDC trusted-publish flow,
# npmjs.org-only) and no --registry (implicit npmjs.org default) -- both
# wrong for a private registry, so this loop reimplements its two lines
# of real logic against CodeArtifact instead of calling `npm run publish`.
#
# No CodeArtifact origin-control step is needed here: these publish as
# @drumwave/dbmate and @drumwave/dbmate-<platform>, names never fetched
# from npmjs.org, so origin-control never blocks them.
- name: Publish packages
working-directory: typescript
run: |
for pkg in dist/@drumwave/dbmate dist/@drumwave/dbmate-*; do
echo "Publishing $pkg"
npm publish "$pkg"
Comment thread
jyothsna-m7 marked this conversation as resolved.
done
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ require (
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/mod v0.38.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/telemetry v0.0.0-20260428171046-76f71b9afea0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 // indirect
golang.org/x/text v0.41.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.44.0 // indirect
golang.org/x/tools v0.48.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
google.golang.org/genproto v0.0.0-20260427160629-7cedc36a6bc4 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260427160629-7cedc36a6bc4 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -530,8 +530,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -579,8 +579,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -622,8 +622,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -688,10 +688,10 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20260428171046-76f71b9afea0 h1:ER5jHKKGuNOscKUx6ChPob4dxC3gP5lkzWXa0JPJWRQ=
golang.org/x/telemetry v0.0.0-20260428171046-76f71b9afea0/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 h1:RJhm5l6Fo4rmEIcndxDllNhhf/fAx8qIm4t6A7vpm2A=
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959/go.mod h1:LV7u5Oco+Z/g6XI7PqN+EUUUGGkEcmB1uj2ceI0fOVg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -704,8 +704,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -763,8 +763,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=
golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbmate/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dbmate

// Version of dbmate
const Version = "2.35.1"
const Version = "2.35.1-drumwave.1"
Comment thread
jyothsna-m7 marked this conversation as resolved.
12 changes: 6 additions & 6 deletions typescript/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ async function main() {
throw new Error(`Unknown arch ${build.arch}`);
}

const name = `@dbmate/${jsOS}-${jsArch}`;
const targetDir = `dist/@dbmate/${jsOS}-${jsArch}`;
const name = `@drumwave/dbmate-${jsOS}-${jsArch}`;
const targetDir = `dist/@drumwave/dbmate-${jsOS}-${jsArch}`;
Comment thread
jyothsna-m7 marked this conversation as resolved.
const binext = jsOS === "win32" ? ".exe" : "";
const templateVars = { jsOS, jsArch, name, version };

Expand Down Expand Up @@ -137,19 +137,19 @@ async function main() {
}

// copy main package
await cp("packages/dbmate", "dist/dbmate", {
await cp("packages/dbmate", "dist/@drumwave/dbmate", {
recursive: true,
});

// write package.json
await writeFile(
"dist/dbmate/package.json",
"dist/@drumwave/dbmate/package.json",
JSON.stringify(mainPackageJson, undefined, 2),
);

// copy readme and license
await cp("../LICENSE", "dist/dbmate/LICENSE");
await cp("../README.md", "dist/dbmate/README.md");
await cp("../LICENSE", "dist/@drumwave/dbmate/LICENSE");
await cp("../README.md", "dist/@drumwave/dbmate/README.md");
}

main().catch((e: unknown) => {
Expand Down
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"clean": "rimraf dist packages/dbmate/dist",
"lint": "eslint --report-unused-disable-directives --fix .",
"lint:ci": "eslint --report-unused-disable-directives .",
"test": "mkdir -p dist/dbmate/node_modules && ln -sfn ../../@dbmate dist/dbmate/node_modules/@dbmate && node --input-type=module -e \"const { resolveBinary } = await import('./dist/dbmate/dist/index.js'); const bin = resolveBinary(); console.log('resolved binary:', bin);\"",
"test": "mkdir -p dist/@drumwave/dbmate/node_modules && ln -sfn ../.. dist/@drumwave/dbmate/node_modules/@drumwave && node --input-type=module -e \"const { resolveBinary } = await import('./dist/@drumwave/dbmate/dist/index.js'); const bin = resolveBinary(); console.log('resolved binary:', bin);\"",
"generate": "tsx generate.ts",
"publish": "tsx publish.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/dbmate/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "dbmate",
"name": "@drumwave/dbmate",
"version": "",
"description": "A lightweight, framework-agnostic database migration tool",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/dbmate/src/resolveBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const require = createRequire(import.meta.url);
* */
export function resolveBinary(): string {
const ext = platform === "win32" ? ".exe" : "";
const path = `@dbmate/${platform}-${arch}/bin/dbmate${ext}`;
const path = `@drumwave/dbmate-${platform}-${arch}/bin/dbmate${ext}`;

try {
return require.resolve(path);
Expand Down