Skip to content

Use version 7.0 of Azure DevOps API (#1102) #708

Use version 7.0 of Azure DevOps API (#1102)

Use version 7.0 of Azure DevOps API (#1102) #708

Workflow file for this run

name: Extension
on:
push:
branches:
- main
tags:
- '*'
paths:
- "extension/**"
- ".github/workflows/extension.yml"
- "!extension/README.md"
- "!docs/**"
pull_request:
branches:
# Only trigger for PRs against `main` branch.
- main
paths:
- "extension/**"
- ".github/workflows/extension.yml"
- "!extension/README.md"
- "!docs/**"
jobs:
Build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v1
with:
useConfigFile: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install
run: npm install
working-directory: '${{ github.workspace }}/extension'
- name: Test
run: npm run test
working-directory: '${{ github.workspace }}/extension'
- name: Build
run: npm run build:prod
working-directory: '${{ github.workspace }}/extension'
- name: Move node_modules
run: npm run mv:prod
working-directory: '${{ github.workspace }}/extension'
- name: Install tfx-cli
run: npm install -g [email protected]
- name: Replace tokens
uses: cschleiden/replace-tokens@v1
with:
files: '["${{ github.workspace }}/extension/overrides*.json"]'
env:
MAJOR_MINOR_PATCH: ${{ steps.gitversion.outputs.majorMinorPatch }}
BUILD_NUMBER: ${{ github.run_number }}
- name: Update values in extension/task/task.json
run: |
echo "`jq '.version.Major=${{ steps.gitversion.outputs.major }}' extension/task/task.json`" > extension/task/task.json
echo "`jq '.version.Minor=${{ steps.gitversion.outputs.minor }}' extension/task/task.json`" > extension/task/task.json
echo "`jq '.version.Patch=${{ github.run_number }}' extension/task/task.json`" > extension/task/task.json
- name: Create Extension (dev)
run: >
tfx extension create
--root extension
--manifest-globs vss-extension.json
--output-path ${{ github.workspace }}/drop/dev
--json5
--overrides-file ${{ github.workspace }}/extension/overrides.dev.json
- name: Create Extension (prod)
run: >
tfx extension create
--root extension
--manifest-globs vss-extension.json
--output-path ${{ github.workspace }}/drop/prod
--json5
--overrides-file ${{ github.workspace }}/extension/overrides.prod.json
- name: Upload Artifact (drop)
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/drop/*
name: drop
Publish:
runs-on: ubuntu-latest
needs: [ Build ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false # wait for previous runs to complete
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: drop
- name: Upload Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: '${{ github.workspace }}/prod/*.vsix,${{ github.workspace }}/dev/*.vsix'
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
allowUpdates: true
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install tfx-cli
run: npm install -g [email protected]
- name: Publish to marketplace (dev)
if: github.ref == 'refs/heads/main'
run: >
tfx extension publish
--vsix ${{ github.workspace }}/dev/*.vsix
--auth-type pat
--token ${{ secrets.AZURE_DEVOPS_EXTENSION_TOKEN }}
--share-with tingle
- name: Publish to marketplace (prod)
if: startsWith(github.ref, 'refs/tags/')
run: >
tfx extension publish
--vsix ${{ github.workspace }}/prod/*.vsix
--auth-type pat
--token ${{ secrets.AZURE_DEVOPS_EXTENSION_TOKEN }}