-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1084 from chromaui/jmhobbs/cap-2192-add-releases
Add Sentry Releases
- Loading branch information
Showing
10 changed files
with
179 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env node | ||
|
||
import { $ } from 'execa'; | ||
|
||
async function main() { | ||
const { stdout: status } = await $`git status --porcelain`; | ||
if (status) { | ||
console.error(`❗️ Working directory is not clean:\n${status}`); | ||
return; | ||
} | ||
|
||
const { stdout: nextVersion } = await $`auto shipit --dry-run --quiet`; | ||
|
||
console.info(`📌 Temporarily bumping version to '${nextVersion}' for build step`); | ||
await $`npm --no-git-tag-version version ${nextVersion}`; | ||
|
||
console.info('📦 Building with new version'); | ||
await $({ | ||
stdio: 'inherit', | ||
env: { | ||
...process.env, | ||
SENTRY_RELEASE: nextVersion, | ||
}, | ||
})`yarn build`; | ||
|
||
console.info('🧹 Resetting changes to let `auto` do its thing'); | ||
await $`git reset --hard`; | ||
|
||
console.info('🌐 Sending sourcemaps to Sentry'); | ||
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli sourcemaps inject dist action`; | ||
await $({ | ||
stdout: 'inherit', | ||
stderr: 'inherit', | ||
})`sentry-cli sourcemaps upload --release=${nextVersion} --dist=cli dist`; | ||
await $({ | ||
stdout: 'inherit', | ||
stderr: 'inherit', | ||
})`sentry-cli sourcemaps upload --release=${nextVersion} --dist=action action`; | ||
|
||
console.info('🚀 Creating new release in Sentry'); | ||
await $({ stdout: 'inherit', stderr: 'inherit' })`sentry-cli releases new ${nextVersion}`; | ||
|
||
console.info('🔗 Associating commits with release'); | ||
await $({ | ||
stdout: 'inherit', | ||
stderr: 'inherit', | ||
})`sentry-cli releases set-commits --auto ${nextVersion}`; | ||
|
||
console.info('🧹 Removing sourcemaps from build'); | ||
await $`yarn clean:sourcemaps`; | ||
|
||
console.info('✅ Build with new version completed, ready for auto!'); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters