Skip to content

Fix auditMode

Fix auditMode #18

Workflow file for this run

name: Build
on:
push:
branches:
- main
paths:
- "src/**"
- ".github/workflows/build-tfx.yml"
- "!LICENSE"
- "!README.md"
- "!docs/**"
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Version Artifact
run: |
# Update task patch number to match build number
echo "`jq '.version.Patch=${{ github.run_number }}' src/task/task.json`" > src/task/task.json
# Current version from vss-extension manifest
current_version=$(jq -r '.version' src/vss-extension.json)
# Increment with build number as patch
IFS='.' read -ra version_parts <<< "$current_version"
version_parts[2]="${GITHUB_RUN_NUMBER:-0}"
updated_version=$(IFS='.'; echo "${version_parts[*]}")
# Update versions in overrides files
jq ".version |= \"0.$updated_version\"" src/overrides.dev.json > src/overrides.dev.json.tmp && mv src/overrides.dev.json.tmp src/overrides.dev.json
jq ".version |= \"$updated_version\"" src/overrides.prod.json > src/overrides.prod.json.tmp && mv src/overrides.prod.json.tmp src/overrides.prod.json
echo -e "New versions are ->\n\tDev: 0.$updated_version\n\tProd: $updated_version"
- name: Install
run: npm install
working-directory: '${{ github.workspace }}/src'
- name: Build
run: npm run build
working-directory: '${{ github.workspace }}/src'
- name: Install tfx-cli
run: npm i -g [email protected]
- name: Package (Dev)
run: >
tfx extension create
--root src
--manifest-globs vss-extension.json
--output-path $GITHUB_WORKSPACE/builds/dev
--overrides-file $GITHUB_WORKSPACE/src/overrides.dev.json
- name: Package (Prod)
run: >
tfx extension create
--root src
--manifest-globs vss-extension.json
--output-path $GITHUB_WORKSPACE/builds/prod
--overrides-file $GITHUB_WORKSPACE/src/overrides.prod.json
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/builds/*
name: 'task-build-${{ github.run_number }}'