From 277116ddd913f5e9c305b7eeda93dfabe6d7dbff Mon Sep 17 00:00:00 2001 From: Sergio Velderrain Date: Wed, 5 Mar 2025 18:06:07 -0800 Subject: [PATCH] Adding v4 --- .../unit-test-and-build-vi-package.yml | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/unit-test-and-build-vi-package.yml b/.github/workflows/unit-test-and-build-vi-package.yml index 82dce9f..4a8e395 100644 --- a/.github/workflows/unit-test-and-build-vi-package.yml +++ b/.github/workflows/unit-test-and-build-vi-package.yml @@ -1,4 +1,4 @@ -name: Run unit tests and build VI Package +name: Build the icon editor on: pull_request: @@ -15,11 +15,6 @@ jobs: name: Build the icon editor runs-on: [self-hosted, iconeditor] - env: - build_id: ${{ github.run_number }} - RelativePath: ${{ vars.AgentWorkingFolder }} - RelativePathScripts: ${{ vars.AgentWorkingFolder }}\pipeline\scripts - steps: - name: Checkout code uses: actions/checkout@v2 @@ -52,41 +47,34 @@ jobs: # Set the output variable for GitHub Actions echo "build_revision=$new_build_revision" >> $env:GITHUB_OUTPUT - # Optional debugging - Get-ChildItem "$env:GITHUB_WORKSPACE/.github" - Get-Content $COUNTER_FILE - - name: Set agent into development mode shell: pwsh - working-directory: ${{ env.RelativePathScripts }} run: | - .\Set_Development_Mode.ps1 -RelativePath "${{ env.RelativePath }}" + .\pipeline\scripts\Set_Development_Mode.ps1 - name: Test and Build the Icon Editor shell: pwsh - working-directory: ${{ env.RelativePathScripts }} + # Put the dynamic variables at the step level, after "get_revision" is available env: - build_id: ${{ env.build_id }} + build_id: ${{ github.run_number }} build_revision: ${{ steps.get_revision.outputs.build_revision }} - build_version: 1.0.${{ env.build_id }}.${{ steps.get_revision.outputs.build_revision }} + build_version: 1.0.${{ github.run_number }}.${{ steps.get_revision.outputs.build_revision }} run: | - .\Build.ps1 -RelativePath "${{ env.RelativePath }}" -AbsolutePathScripts "${{ env.RelativePathScripts }}" + .\pipeline\scripts\Build.ps1 -build_version $env:build_version - name: Restore agent from development mode shell: pwsh - working-directory: ${{ env.RelativePathScripts }} run: | - .\RevertDevelopmentMode.ps1 -RelativePath "${{ env.RelativePath }}" + .\pipeline\scripts\RevertDevelopmentMode.ps1 - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: vi-package - # Since your workflow base directory is $GITHUB_WORKSPACE, - # simply reference the relative path. Use quotes because of the space. path: 'builds/VI Package' - name: Commit and Push Build Counter + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: 'Increment build revision to ${{ steps.get_revision.outputs.build_revision }}'