From c2465530dd017287c19e0880f3661c197f5b44c1 Mon Sep 17 00:00:00 2001 From: Scott Claiborne Date: Wed, 29 Apr 2026 11:41:04 -0700 Subject: [PATCH 1/3] Remove old AS411 GitHub Actions workflows --- .github/workflows/build.yml | 32 ------------------------ .github/workflows/buildPublish.yml | 40 ------------------------------ 2 files changed, 72 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/buildPublish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 9bda386..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will run build an AS project and publish the libraries to the github package registry - -name: Build Libraries - -on: - workflow_dispatch: - push: - branches-ignore: - - 'main' - -jobs: - build-libraries: - runs-on: [AS411] - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - path: "main" - lfs: true - - name: Fix LFS - run: | - cd ./main - git lfs pull - - name: Install AS upgrades - run: python.exe C:/Tools/AsPython/InstallUpgrades.py ${{ github.workspace }}/main/upgrades -asp AS411 -r --logLevel DEBUG - - name: Build project - run: python.exe C:/Tools/AsPython/CmdLineBuild.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -c Intel ARM -bm Rebuild -sim --logLevel DEBUG - - name: Export libraries - run: python.exe C:/Tools/AsPython/CmdLineExportLib.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -dest ./libs -c Intel ARM -wl vartools -l DEBUG -o -bm "None" \ No newline at end of file diff --git a/.github/workflows/buildPublish.yml b/.github/workflows/buildPublish.yml deleted file mode 100644 index aec954e..0000000 --- a/.github/workflows/buildPublish.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will run build an AS project and publish the libraries to the github package registry - -name: Build Publish Libraries - -on: - workflow_dispatch: - push: - branches: - - main - tags: - - v* - -jobs: - build-publish-libraries: - runs-on: [AS411] - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - with: - submodules: 'true' - path: "main" - lfs: true - - name: Fix LFS - run: | - cd ./main - git lfs pull - - name: Install AS upgrades - run: python.exe C:/Tools/AsPython/InstallUpgrades.py ${{ github.workspace }}/main/upgrades -asp AS411 -r --logLevel DEBUG - - name: Build project - run: python.exe C:/Tools/AsPython/CmdLineBuild.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -c Intel ARM -bm Rebuild -sim --logLevel DEBUG - - name: Export libraries - run: python.exe C:/Tools/AsPython/CmdLineExportLib.py ${{ github.workspace }}/main/example/AsProject/AsProject.apj -dest ./libs -c Intel ARM -wl vartools -l DEBUG -o -bm "None" - - name: Publish libraries - run: | - cd ./libs/vartools - python.exe C:/Tools/LPM/src/LPM.py login -s -t ${{ secrets.GITHUB_TOKEN }} -nc - python.exe C:/Tools/LPM/src/LPM.py init -s -lib -nc - python.exe C:/Tools/LPM/src/LPM.py publish -s -nc \ No newline at end of file From b3e8bb0b6d090fdd27cce2b34cbc923db0b5d453 Mon Sep 17 00:00:00 2001 From: Scott Claiborne Date: Wed, 29 Apr 2026 11:42:02 -0700 Subject: [PATCH 2/3] Add AS6 GitHub Actions workflows --- .github/workflows/build-export-publish.yml | 126 +++++++++++++++++++++ .github/workflows/build.yml | 57 ++++++++++ 2 files changed, 183 insertions(+) create mode 100644 .github/workflows/build-export-publish.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-export-publish.yml b/.github/workflows/build-export-publish.yml new file mode 100644 index 0000000..c0f6bf2 --- /dev/null +++ b/.github/workflows/build-export-publish.yml @@ -0,0 +1,126 @@ +name: Build, Export, and Publish + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + inputs: + version: + description: 'Version to publish (e.g. v0.16.0)' + required: true + +jobs: + build-export-publish: + runs-on: [AS6-runner] + + permissions: + contents: read + packages: write + + env: + PROJECT: example/AsProject/AsProject.apj + PROJECT_DIR: example/AsProject + LIBRARY: VarTools + LIBRARY_DIR: src/Ar/VarTools + EXPORT_DIR: export + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://npm.pkg.github.com' + scope: '@loupeteam' + + - name: Resolve version + id: version + shell: pwsh + run: | + if ($env:GITHUB_REF_TYPE -eq 'tag') { + $ver = $env:GITHUB_REF_NAME -replace '^v', '' + } else { + $ver = "${{ inputs.version }}" -replace '^v', '' + } + if (-not $ver) { + Write-Error "Could not determine version. Push a v*.*.* tag or supply the version input." + exit 1 + } + Write-Host "Publishing version: $ver" + "version=$ver" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_OUTPUT + + - name: Find AS6 build executable + uses: loupeteam/br-actions/find-as6-build@v1 + id: find-as + + - name: Build Intel + uses: loupeteam/br-actions/build-as-project@v1 + with: + exe-path: ${{ steps.find-as.outputs.exe-path }} + project: ${{ env.PROJECT }} + config: Intel + + - name: Build ARM + uses: loupeteam/br-actions/build-as-project@v1 + with: + exe-path: ${{ steps.find-as.outputs.exe-path }} + project: ${{ env.PROJECT }} + config: ARM + + - name: Export library + uses: loupeteam/br-actions/export-as-library@v1 + with: + project-dir: ${{ env.PROJECT_DIR }} + library: ${{ env.LIBRARY }} + library-dir: ${{ env.LIBRARY_DIR }} + configs: Intel ARM + output: ${{ env.EXPORT_DIR }} + as-install: ${{ steps.find-as.outputs.install-path }} + + - name: Locate exported version directory + id: export-dir + shell: pwsh + run: | + $path = Get-ChildItem "$env:EXPORT_DIR/$env:LIBRARY" -Directory | + Select-Object -First 1 -ExpandProperty FullName + if (-not $path) { + Write-Error "No exported version directory found under $env:EXPORT_DIR/$env:LIBRARY" + exit 1 + } + Write-Host "Exported version directory: $path" + "path=$path" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_OUTPUT + + - name: Generate package.json + uses: loupeteam/br-actions/prepare-lpm-package@v1 + with: + library-dir: ${{ env.LIBRARY_DIR }} + output-dir: ${{ steps.export-dir.outputs.path }} + version: ${{ steps.version.outputs.version }} + + - name: Publish to GitHub Packages + shell: pwsh + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + Write-Host "Publishing @loupeteam/$($env:LIBRARY.ToLower())@${{ steps.version.outputs.version }}" + Push-Location "${{ steps.export-dir.outputs.path }}" + npm publish + Pop-Location + + - name: Upload exported library artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.LIBRARY }}-${{ steps.version.outputs.version }} + path: ${{ env.EXPORT_DIR }}/${{ env.LIBRARY }}/ + if-no-files-found: error + + - name: Upload build diagnostics + if: always() + uses: actions/upload-artifact@v4 + with: + name: BuildDiagnostics + path: example/AsProject/Temp/BuildDiagnostics.log + if-no-files-found: ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..aff3066 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +name: Build + +on: + workflow_dispatch: + inputs: + build-mode: + description: 'Build mode' + required: false + default: 'Build' + type: choice + options: + - Build + - Rebuild + pull_request: + paths-ignore: + - '**/*.md' + - 'docs/**' + - 'LICENSE' + +jobs: + build: + runs-on: [AS6-runner] + + env: + PROJECT: example/AsProject/AsProject.apj + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Find AS6 build executable + uses: loupeteam/br-actions/find-as6-build@v1 + id: find-as + + - name: Build Intel + uses: loupeteam/br-actions/build-as-project@v1 + with: + exe-path: ${{ steps.find-as.outputs.exe-path }} + project: ${{ env.PROJECT }} + config: Intel + build-mode: ${{ inputs.build-mode || 'Build' }} + + - name: Build ARM + uses: loupeteam/br-actions/build-as-project@v1 + with: + exe-path: ${{ steps.find-as.outputs.exe-path }} + project: ${{ env.PROJECT }} + config: ARM + build-mode: ${{ inputs.build-mode || 'Build' }} + + - name: Upload build diagnostics + if: always() + uses: actions/upload-artifact@v4 + with: + name: BuildDiagnostics + path: example/AsProject/Temp/BuildDiagnostics.log + if-no-files-found: ignore From 8de69f060fbc75ac8189c2cdbf1aed1902525d61 Mon Sep 17 00:00:00 2001 From: Scott Claiborne Date: Wed, 29 Apr 2026 11:43:59 -0700 Subject: [PATCH 3/3] Add package.json for lpm publishing --- src/Ar/VarTools/package.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/Ar/VarTools/package.json diff --git a/src/Ar/VarTools/package.json b/src/Ar/VarTools/package.json new file mode 100644 index 0000000..b1c3364 --- /dev/null +++ b/src/Ar/VarTools/package.json @@ -0,0 +1,18 @@ +{ + "name": "@loupeteam/vartools", + "version": "0.0.0", + "description": "Helper library for getting and setting variable values in B&R Automation Studio", + "homepage": "https://loupeteam.github.io/LoupeDocs/libraries/vartools.html", + "scripts": {}, + "keywords": [], + "author": "Loupe", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/loupeteam/vartools" + }, + "lpm": { + "type": "library" + }, + "dependencies": {} +}