Skip to content

Commit

Permalink
Fix cargo publish must run in actual package
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSensor committed Jun 29, 2019
1 parent 0769a32 commit 56c8437
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,6 @@ steps:
displayName: Install rust
condition: ne( variables['Agent.OS'], 'Windows_NT' )

- bash: |
ln README.md packages/core/README.md
./scripts/package.sh --allow-dirty
displayName: Package crates
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/target/package
contents: '**.crate'
targetFolder: $(Build.CratesDirectory)
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Build.CratesDirectory)
archiveType: tar
tarCompression: gz
archiveFile: $(Build.ArtifactStagingDirectory)/crate/scdlang-$(TARGET).tar.gz
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/crate'
artifactName: crates

- script: rustup target add $(TARGET)
displayName: Install target toolchain

Expand Down Expand Up @@ -135,11 +115,27 @@ steps:
# isDraft: true
# addChangeLog: true

- bash: |
ln README.md packages/core/README.md
./scripts/package.sh --allow-dirty
displayName: Package crates
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/target/package
contents: '**.crate'
targetFolder: $(Build.ArtifactStagingDirectory)/crate
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/crate'
artifactName: crates

# TODO: Split this as a separate job after GitHubRelease@0 done
# But it has a caveat, it need to install rust again :sad: (no build needed)
- powershell: |
- bash: |
cargo login $env:DRSENSOR
cargo publish
for cargo_toml in packages/{*,transpiler/*}/Cargo.toml; do
cargo publish --manifest-path $cargo_toml --no-verify
done
displayName: Publish to crates.io
condition: and(and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')), eq( variables['Agent.OS'], 'Windows_NT' ))
env:
Expand Down

0 comments on commit 56c8437

Please sign in to comment.