Skip to content

Update unit-test-and-build-vi-package.yml #7

Update unit-test-and-build-vi-package.yml

Update unit-test-and-build-vi-package.yml #7

# .github/workflows/reusable-workflow.yml
name: Reusable Build
on:
workflow_call:
inputs:
working-folder:
required: true
type: string
scripts-folder:
required: true
type: string
secrets:
GITHUB_TOKEN:

Check failure on line 14 in .github/workflows/reusable-workflow.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable-workflow.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
build-and-test:
runs-on: [self-hosted, iconeditor]
env:
RelativePath: ${{ inputs.working-folder }}
RelativePathScripts: ${{ inputs.scripts-folder }}
steps:
# Same steps you have now, except you read from the 'inputs'
# rather than your vars.AgentWorkingFolder, etc.
- name: Checkout code
uses: actions/checkout@v3
- name: Get Build Revision
id: get_revision
shell: bash
run: |
...
# Use $GITHUB_ENV instead of ::set-output (since set-output is deprecated).
# E.g.:
# echo "build_revision=$new_build_revision" >> $GITHUB_ENV
- name: Set agent into development mode
shell: pwsh
working-directory: ${{ env.RelativePathScripts }}
run: |
.\Set_Development_Mode.ps1 -RelativePath "${{ env.RelativePath }}"
- name: Test and Build
shell: pwsh
working-directory: ${{ env.RelativePathScripts }}
env:
build_id: ${{ env.build_id }}
build_revision: ${{ env.build_revision }}
build_version: ${{ env.build_version }}
run: |
.\Build.ps1 -RelativePath "${{ env.RelativePath }}" `
-AbsolutePathScripts "${{ env.RelativePathScripts }}"
- name: Restore agent from development mode
shell: pwsh
working-directory: ${{ env.RelativePathScripts }}
run: |
.\RevertDevelopmentMode.ps1 -RelativePath "${{ env.RelativePath }}"
- 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 ${{ env.build_revision }}'
file_pattern: '.github/buildCounter.txt'