Skip to content

Commit

Permalink
Add release pipeline for typespec-go emitter (#1400)
Browse files Browse the repository at this point in the history
Pipeline was copied from publish-release-go.yml and slightly modified.
  • Loading branch information
jhendrixMSFT committed Jul 15, 2024
1 parent d20cc60 commit cb4408d
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions eng/pipelines/publish-release-typespec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
trigger: none
pr: none


extends:
template: /eng/pipelines/templates/stages/1es-redirect.yml
parameters:
stages:
- stage: Release

variables:
- template: /eng/pipelines/templates/variables/image.yml

jobs:
- job: Release
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux

steps:
- template: /eng/steps/set-env.yaml

- template: /eng/steps/build-test-typespec.yaml

- pwsh: |
$currentVersion = node -p -e "require('./packages/typespec-go/package.json').version";
cd packages/typespec-go
npm version --no-git-tag-version $currentVersion
npm pack;
npm install -g azure-tools-typespec-go-$currentVersion.tgz
if ($LASTEXITCODE) {
exit $LASTEXITCODE
}
npx publish-release `
--token $(azuresdk-github-pat) `
--repo autorest.go `
--owner azure `
--name "TypeSpec emitter for Go SDKs v$currentVersion" `
--tag v$currentVersion --notes='TypeSpec emitter for Go SDKs' `
--prerelease --editRelease false `
--assets azure-tools-typespec-go-$currentVersion.tgz `
--target_commitish $(Build.SourceBranchName);
displayName: "Publish GitHub Release"
- script: |
cd packages/typespec-go
echo "//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" > ./.npmrc
npm publish --access public
displayName: "Publish to npm"

0 comments on commit cb4408d

Please sign in to comment.