mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
72e9dc6a3c
Using the `env:` yaml key is not actually needed unless the variables contain secret/sensitive information. (These varibales won't have sensitive content, just a repo owner and some repo names). These environment variables would expand to literally `${VAR_NAME}`, rather than to an empty string, if not explicitly set in Azure DevOps. This would make consuming the variables in JavaScript unnecessarily awkward. Instead, we can set reasonable defaults if the variables are falsy (i.e. unset or null in our case), and otherwise override with what's manually set in the environment variables.
78 lines
2.7 KiB
YAML
78 lines
2.7 KiB
YAML
trigger:
|
|
- master
|
|
- 1.* # VSTS only supports wildcards at the end
|
|
- electron-*
|
|
pr: none # no PR triggers
|
|
|
|
jobs:
|
|
- job: GetReleaseVersion
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
steps:
|
|
# This has to be done separately because VSTS inexplicably
|
|
# exits the script block after `npm ci` completes.
|
|
- script: |
|
|
cd script/vsts
|
|
npm ci
|
|
displayName: npm ci
|
|
- script: node script/vsts/get-release-version.js
|
|
name: Version
|
|
|
|
# Import OS-specific build definitions.
|
|
- template: platforms/windows.yml
|
|
- template: platforms/macos.yml
|
|
- template: platforms/linux.yml
|
|
|
|
- job: UploadArtifacts
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
dependsOn:
|
|
- GetReleaseVersion
|
|
- Windows_RendererTests
|
|
- Linux
|
|
- macOS_tests
|
|
|
|
variables:
|
|
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
|
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
|
|
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
|
|
|
|
steps:
|
|
# This has to be done separately because VSTS inexplicably
|
|
# exits the script block after `npm ci` completes.
|
|
- script: |
|
|
cd script/vsts
|
|
npm ci
|
|
env:
|
|
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
|
displayName: npm ci
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
inputs:
|
|
itemPattern: '**'
|
|
downloadType: 'specific'
|
|
displayName: Download Release Artifacts
|
|
|
|
- script: |
|
|
node $(Build.SourcesDirectory)/script/vsts/upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom-staging"
|
|
env:
|
|
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
|
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
|
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
|
|
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
|
|
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
|
|
PACKAGE_CLOUD_API_KEY: $(PACKAGE_CLOUD_API_KEY)
|
|
displayName: Create Draft Release
|
|
condition: and(succeeded(), eq(variables['Atom.AutoDraftRelease'], 'true'), eq(variables['IsReleaseBranch'], 'true'))
|
|
|
|
- script: |
|
|
node $(Build.SourcesDirectory)/script/vsts/upload-artifacts.js --assets-path "$(System.ArtifactsDirectory)" --s3-path "vsts-artifacts/$(Build.BuildId)/"
|
|
env:
|
|
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
|
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
|
|
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
|
|
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
|
|
displayName: Upload CI Artifacts to S3
|
|
condition: and(succeeded(), eq(variables['IsSignedZipBranch'], 'true'))
|