Skip to content

Feature/ci cd update (#155) #38

Feature/ci cd update (#155)

Feature/ci cd update (#155) #38

name: Build VI Package
on:
pull_request:
branches: [main, develop, release/*, hotfix/*]
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [main, develop, release/*, hotfix/*]
workflow_dispatch:
jobs:
build-vi-package:
name: Build VI Package
runs-on: [self-hosted, iconeditor]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Build Revision
id: get_revision
shell: pwsh
run: |
$COUNTER_FILE = "$env:GITHUB_WORKSPACE/.github/buildCounter.txt"
if (-Not (Test-Path $COUNTER_FILE)) {
"1" | Out-File $COUNTER_FILE
}
$build_revision = Get-Content $COUNTER_FILE
$new_build_revision = [int]$build_revision + 1
$new_build_revision | Out-File $COUNTER_FILE
echo "build_revision=$new_build_revision" >> $env:GITHUB_OUTPUT
- name: Build the icon editor VI package
shell: pwsh
# GitHub sets $GITHUB_WORKSPACE automatically
env:
build_id: ${{ github.run_number }}
build_revision: ${{ steps.get_revision.outputs.build_revision }}
build_version: 1.0.${{ github.run_number }}.${{ steps.get_revision.outputs.build_revision }}
run: |
$repoRoot = $env:GITHUB_WORKSPACE
$scriptsFolder = Join-Path $repoRoot 'pipeline/scripts'
# Call the script with defaulted paths
.\pipeline\scripts\Build_all.ps1 -RelativePath $repoRoot -AbsolutePathScripts $scriptsFolder
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: vi-package
path: 'builds/VI Package'