-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Expand file tree
/
Copy pathArtifact-to-ADO-feed.yml
More file actions
48 lines (40 loc) · 1.58 KB
/
Artifact-to-ADO-feed.yml
File metadata and controls
48 lines (40 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
pool:
vmImage: 'ubuntu-latest'
variables:
feedName: 'Test-feed' # <-- Replace with your Azure Artifacts feed
packageName: 'flask-sample-app' # <-- Name for the universal package
packageVersion: '1.0.$(Build.BuildId)'
steps:
# 1️⃣ Checkout your GitHub repo
- checkout: self
displayName: 'Checkout repository'
# 2️⃣ Optional: Debug repo contents
- script: |
echo "Repo root: $(Build.SourcesDirectory)"
echo "Contents:"
ls -la $(Build.SourcesDirectory)
displayName: 'List repo root contents'
# 3️⃣ Ensure artifact staging directory exists
- script: mkdir -p $(Build.ArtifactStagingDirectory)
displayName: 'Ensure artifact staging directory exists'
# 4️⃣ Archive the entire repo into a zip
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)' # <-- This is the correct folder
includeRootFolder: false # <-- Include only contents
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/flask-app.zip'
replaceExistingArchive: true
displayName: 'Archive repository'
# 5️⃣ Publish the zip as a Universal Package
- task: UniversalPackages@0
inputs:
command: publish
publishDirectory: '$(Build.ArtifactStagingDirectory)'
feedsToUsePublish: 'internal'
vstsFeedPublish: 'DevOpsAZ400 Pratice (Agile one)/Test-Feed'
vstsFeedPackagePublish: '$(packageName)'
versionOption: 'custom'
versionPublish: '$(packageVersion)'
packagePublishDescription: 'Simple Flask sample app packaged as Universal Package'
displayName: 'Publish Universal Package'