Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/build-export-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,36 @@ jobs:
output: ${{ env.EXPORT_DIR }}
as-install: ${{ steps.find-as.outputs.install-path }}

# Inject the release version into package.json and publish
# The export action writes to {output}/{library}/V{version}/. Capture
# that path so downstream steps can write package.json into it and run
# `npm publish` from there.
- 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: |
# Locate the exported version directory (e.g. export/StringExt/V0.16.0/)
$versionDir = Get-ChildItem "$env:EXPORT_DIR/$env:LIBRARY" -Directory |
Select-Object -First 1 -ExpandProperty FullName

# Read the package.json template from source, update version, write to export
$pkg = Get-Content "$env:LIBRARY_DIR/package.json" | ConvertFrom-Json
$pkg.version = "${{ steps.version.outputs.version }}"
$pkg | ConvertTo-Json -Depth 10 | Set-Content (Join-Path $versionDir "package.json")

Write-Host "Publishing @loupeteam/$($env:LIBRARY.ToLower())@${{ steps.version.outputs.version }}"
Push-Location $versionDir
Push-Location "${{ steps.export-dir.outputs.path }}"
npm publish
Pop-Location

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ on:
options:
- Build
- Rebuild
# Build on PRs targeting any branch.
#
# SECURITY NOTE: this uses the standard `pull_request` trigger, which checks
# out the PR head but runs with read-only token and no access to secrets when
# the PR comes from a fork. Combined with the repo setting
# Settings → Actions → General →
# "Require approval for all outside collaborators"
# (or "Require approval for first-time contributors"), this means workflows
# from external contributors will not run on a self-hosted runner until a
# maintainer reviews the PR and clicks "Approve and run".
# Do NOT switch this to `pull_request_target` — that runs in the context of
# the base branch with full permissions and would expose the runner.
pull_request:
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'

jobs:
build:
Expand Down
11 changes: 0 additions & 11 deletions Jenkinsfile

This file was deleted.

10 changes: 10 additions & 0 deletions example/As6Project/AsProject.apj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="6.5.1.7" WorkingVersion="6.5"?>
<Project Description="Starter Automation Studio project." Version="1.0.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<Communication />
<ANSIC DefaultIncludes="true" />
<IEC ExtendedConstants="true" IecExtendedComments="true" KeywordsAsStructureMembers="false" NamingConventions="true" Pointers="true" Preprocessor="false" />
<Motion RestartAcoposParameter="true" RestartInitParameter="true" />
<Project StoreRuntimeInProject="false" />
<Variables DefaultInitValue="0" DefaultRetain="false" DefaultVolatile="true" />
</Project>
4 changes: 4 additions & 0 deletions example/As6Project/Logical/Global.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

TYPE

END_TYPE
8 changes: 8 additions & 0 deletions example/As6Project/Logical/Global.var
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

VAR

END_VAR

VAR CONSTANT

END_VAR
7 changes: 7 additions & 0 deletions example/As6Project/Logical/Libraries/Loupe/Package.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\stringext\ANSIC.lby</Object>
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Reference path uses src\Ar\stringext\ANSIC.lby (different casing than the actual src/Ar/StringExt/... directory). This can break builds on case-sensitive filesystems (and makes the reference brittle). Update the path to match the real directory casing.

Suggested change
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\stringext\ANSIC.lby</Object>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\StringExt\ANSIC.lby</Object>

Copilot uses AI. Check for mistakes.
</Objects>
</Package>
8 changes: 8 additions & 0 deletions example/As6Project/Logical/Libraries/Package.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Package">_AS</Object>
<Object Type="Package">Loupe</Object>
</Objects>
</Package>
80 changes: 80 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.fun
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsftoa : UINT (*converts a REAL value into a character string*)
VAR_INPUT
value :REAL; (*REAL (FLOAT) value to be converted into a character string*)
pString :UDINT; (*pointer to the destination character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatof : REAL (*converts a character string into a REAL (FLOAT) value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatod : LREAL (*converts a character string into a LREAL (DOUBLE) value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsitoa : UINT (*converts a DINT value into a character string*)
VAR_INPUT
value :DINT; (*numerical value to be converted into a string*)
pString :UDINT; (*pointer to the destination character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatoi : DINT (*converts a character string into a DINT value*)
VAR_INPUT
pString :UDINT; (*pointer to the character string to be converted*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemset : UDINT (*fills the memory area with specific values*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
value :USINT; (*initialization value*)
length :UDINT; (*number of bytes to be initialized*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcpy : UDINT (*copies the memory area*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
pSrc :UDINT; (*pointer to the data to be copied*)
length :UDINT; (*size of bytes to be copied*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemmove : UDINT (*copies the memory area (even if the memory areas overlap)*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination memory*)
pSrc :UDINT; (*pointer to the data to be copied*)
length :UDINT; (*size of bytes to be copied*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcmp : DINT (*compares memory areas*)
VAR_INPUT
pMem1 :UDINT; (*pointer to the memory area 1*)
pMem2 :UDINT; (*pointer to the memory area 2*)
length :UDINT; (*size of bytes to be checked*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcat : UDINT (*attaches character strings to one another*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination character string*)
pSrc :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrlen : UDINT (*provides the length of a character string*)
VAR_INPUT
pString :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcpy : UDINT (*copies one character string into another*)
VAR_INPUT
pDest :UDINT; (*pointer to the destination character string*)
pSrc :UDINT; (*pointer to the source character string*)
END_VAR
END_FUNCTION
{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcmp : DINT (*compares two character strings*)
VAR_INPUT
pString1 :UDINT; (*pointer to the first character string*)
pString2 :UDINT; (*pointer to the second character string*)
END_VAR
END_FUNCTION

4 changes: 4 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

TYPE

END_TYPE
4 changes: 4 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.var
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

VAR CONSTANT

END_VAR
39 changes: 39 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/SG3/AsBrStr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */

#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif

#include <bur/plctypes.h>

#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif




/* Prototyping of functions and function blocks */
unsigned short brsftoa(float value, unsigned long pString);
float brsatof(unsigned long pString);
unsigned short brsitoa(signed long value, unsigned long pString);
signed long brsatoi(unsigned long pString);
unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
unsigned long brsstrlen(unsigned long pString);
unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
signed long brsstrcmp(unsigned long pString1, unsigned long pString2);


#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

39 changes: 39 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/SG4/AsBrStr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */

#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif

#include <bur/plctypes.h>

#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif



/* Prototyping of functions and function blocks */
_BUR_PUBLIC unsigned short brsftoa(float value, unsigned long pString);
_BUR_PUBLIC float brsatof(unsigned long pString);
_BUR_PUBLIC double brsatod(unsigned long pString);
_BUR_PUBLIC unsigned short brsitoa(signed long value, unsigned long pString);
_BUR_PUBLIC signed long brsatoi(unsigned long pString);
_BUR_PUBLIC unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
_BUR_PUBLIC unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
_BUR_PUBLIC unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
_BUR_PUBLIC signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
_BUR_PUBLIC unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
_BUR_PUBLIC unsigned long brsstrlen(unsigned long pString);
_BUR_PUBLIC unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
_BUR_PUBLIC signed long brsstrcmp(unsigned long pString1, unsigned long pString2);


#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

39 changes: 39 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/SGC/AsBrStr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Automation Studio generated header file */
/* Do not edit ! */

#ifndef _ASBRSTR_
#define _ASBRSTR_
#ifdef __cplusplus
extern "C"
{
#endif

#include <bur/plctypes.h>

#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif




/* Prototyping of functions and function blocks */
unsigned short brsftoa(float value, unsigned long pString);
float brsatof(unsigned long pString);
unsigned short brsitoa(signed long value, unsigned long pString);
signed long brsatoi(unsigned long pString);
unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
unsigned long brsstrlen(unsigned long pString);
unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
signed long brsstrcmp(unsigned long pString1, unsigned long pString2);


#ifdef __cplusplus
};
#endif
#endif /* _ASBRSTR_ */

9 changes: 9 additions & 0 deletions example/As6Project/Logical/Libraries/_AS/AsBrStr/binary.lby
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.0.0?>
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsBrStr Library contains FBKs for memory and character string handling.">
<Files>
<File>AsBrStr.fun</File>
<File>AsBrStr.typ</File>
<File>AsBrStr.var</File>
</Files>
</Library>
Loading
Loading