|
1 | 1 | name: release |
2 | 2 | on: |
3 | 3 | release: |
4 | | - types: [published] |
| 4 | + types: [ published ] |
5 | 5 |
|
6 | 6 | defaults: |
7 | 7 | run: |
8 | 8 | shell: pwsh |
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | build: |
12 | | - |
13 | 12 | runs-on: ${{ matrix.os }} |
14 | 13 | strategy: |
15 | 14 | matrix: |
16 | | - os: [ubuntu-latest] |
| 15 | + os: [ ubuntu-latest ] |
17 | 16 | steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - - name: Fetch all history for all tags and branches |
20 | | - run: | |
21 | | - git fetch --prune --unshallow |
22 | | - - run: | |
23 | | - npm install |
24 | | - npm run build:agent:github |
25 | | - npm run build:agent:azure |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + fetch-depth: 0 |
| 20 | + token: ${{ secrets.PUSH_GITHUB_TOKEN }} |
| 21 | + - run: | |
| 22 | + npm install |
| 23 | + npm run build:agent:github |
| 24 | + npm run build:agent:azure |
| 25 | +
|
| 26 | + # npm run compress:github |
| 27 | + # npm run compress:azure |
| 28 | + name: Build code |
| 29 | + - name: Install GitVersion |
| 30 | + uses: ./gitversion/setup |
| 31 | + with: |
| 32 | + versionSpec: '5.x' |
| 33 | + - name: Use GitVersion |
| 34 | + id: gitversion # step id used as reference for output values |
| 35 | + uses: ./gitversion/execute |
| 36 | + - run: | |
| 37 | + $date = Get-Date -format "yyMMddHH" |
| 38 | + $version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date" |
| 39 | + $major = "${{steps.gitversion.outputs.major}}" |
| 40 | + $minor = "${{steps.gitversion.outputs.minor}}" |
| 41 | + $patch = "${{steps.gitversion.outputs.patch}}" |
26 | 42 |
|
27 | | - # npm run compress:github |
28 | | - # npm run compress:azure |
29 | | - name: Build code |
30 | | - - name: Install GitVersion |
31 | | - uses: ./gitversion/setup |
32 | | - with: |
33 | | - versionSpec: '5.x' |
34 | | - - name: Use GitVersion |
35 | | - id: gitversion # step id used as reference for output values |
36 | | - uses: ./gitversion/execute |
37 | | - - run: | |
38 | | - $date = Get-Date -format "yyMMddHH" |
39 | | - $version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date" |
40 | | - $major = "${{steps.gitversion.outputs.major}}" |
41 | | - $minor = "${{steps.gitversion.outputs.minor}}" |
42 | | - $patch = "${{steps.gitversion.outputs.patch}}" |
| 43 | + . .\update-version.ps1 # Import the functions |
| 44 | + update-manifest .\dist\azure\vss-extension.json -Version $version |
| 45 | + dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch } |
43 | 46 |
|
44 | | - . .\update-version.ps1 # Import the functions |
45 | | - update-manifest .\dist\azure\vss-extension.json -Version $version |
46 | | - dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch } |
| 47 | + npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }} |
| 48 | + name: Publish Azure extension |
| 49 | + - name: Get tags |
| 50 | + id: get-tags |
| 51 | + shell: pwsh |
| 52 | + run: | |
| 53 | + # Finding the version from release tag |
47 | 54 |
|
48 | | - npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }} |
| 55 | + $newTag = "${{steps.gitversion.outputs.majorMinorPatch}}" |
| 56 | + $oldTag = $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)).Trim("v") |
| 57 | + echo "Old tag: $oldTag" |
| 58 | + echo "New tag: $newTag" |
49 | 59 |
|
50 | | - name: Publish Azure extension |
| 60 | + "oldTag=$oldTag" >> $env:GITHUB_OUTPUT |
| 61 | + "newTag=$newTag" >> $env:GITHUB_OUTPUT |
| 62 | + - uses: peter-evans/repository-dispatch@v3 |
| 63 | + name: Trigger Update Examples version |
| 64 | + with: |
| 65 | + token: ${{ secrets.RELEASE_GITHUB_TOKEN }} |
| 66 | + repository: ${{ github.repository }} |
| 67 | + event-type: update-examples |
| 68 | + client-payload: '{"oldTag": "${{ steps.get-tags.outputs.oldTag }}", "newTag": "${{ steps.get-tags.outputs.newTag }}"}' |
0 commit comments