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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
126 changes: 126 additions & 0 deletions .github/workflows/build-export-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Build, Export, and Publish

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g. v1.0.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: LLHttp
LIBRARY_DIR: src/Ar/LLHttp
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
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 0 additions & 11 deletions Jenkinsfile

This file was deleted.

6 changes: 3 additions & 3 deletions example/AsProject/AsProject.apj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.11.5.46 SP" WorkingVersion="4.11"?>
<Project Description="Starter Automation Studio project." Version="1.00.0" Edition="Standard" EditionComment="Standard" xmlns="http://br-automation.co.at/AS/Project">
<?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" />
<TechnologyPackages>
<Acp10Arnc0 Version="5.15.1" />
<OpcUaCs Version="6.6.1" />
</TechnologyPackages>
</Project>
9 changes: 9 additions & 0 deletions example/AsProject/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License

Copyright 2023 Loupe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion example/AsProject/Logical/Libraries/Loupe/Package.pkg
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\llhttp\ANSIC.lby</Object>
<Object Type="Library" Language="Binary">tcpcomm</Object>
<Object Type="Library" Language="Binary">ringbuflib</Object>
<Object Type="Library" Language="Binary">stringext</Object>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\LLHttp\ANSIC.lby</Object>
</Objects>
</Package>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version='1.0' encoding='utf-8'?>
<Library xmlns="http://br-automation.co.at/AS/Library" Version="0.02.4" SubType="Binary">
<Library xmlns="http://br-automation.co.at/AS/Library" Version="1.0.0" SubType="Binary">
<Files>
<File Description="Exported data types">RingBufLib.typ</File>
<File Description="Exported functions and function blocks">RingBufLib.fun</File>
<File Type="File">CHANGELOG.md</File>
</Files>
</Files>
<Dependencies>
<Dependency ObjectName="AsBrStr" />
</Dependencies>
</Library>
</Library>
22 changes: 0 additions & 22 deletions example/AsProject/Logical/Libraries/Loupe/ringbuflib/CHANGELOG.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Automation Studio generated header file */
/* Do not edit ! */
/* ringbuflib 0.02.4 */
/* RingBufLib 1.0.0 */

#ifndef _RINGBUFLIB_
#define _RINGBUFLIB_
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _ringbuflib_VERSION
#define _ringbuflib_VERSION 0.02.4
#ifndef _RingBufLib_VERSION
#define _RingBufLib_VERSION 1.0.0
#endif

#include <bur/plctypes.h>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Automation Studio generated header file */
/* Do not edit ! */
/* ringbuflib 0.02.4 */
/* RingBufLib 1.0.0 */

#ifndef _RINGBUFLIB_
#define _RINGBUFLIB_
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _ringbuflib_VERSION
#define _ringbuflib_VERSION 0.02.4
#ifndef _RingBufLib_VERSION
#define _RingBufLib_VERSION 1.0.0
#endif

#include <bur/plctypes.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* Automation Studio generated header file */
/* Do not edit ! */
/* RingBufLib 1.0.0 */

#ifndef _RINGBUFLIB_
#define _RINGBUFLIB_
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _RingBufLib_VERSION
#define _RingBufLib_VERSION 1.0.0
#endif

#include <bur/plctypes.h>

#ifndef _BUR_PUBLIC
#define _BUR_PUBLIC
#endif
#ifdef _SG3
#include "AsBrStr.h"
#endif
#ifdef _SG4
#include "AsBrStr.h"
#endif
#ifdef _SGC
#include "AsBrStr.h"
#endif


/* Datatypes and datatypes of function blocks */
typedef enum RING_BUF_ERR
{ RING_BUF_ERR_INVALID_BUFFER,
RING_BUF_ERR_INVALID_BUF_POINTER,
RING_BUF_ERR_DATA_NOT_INIT,
RING_BUF_ERR_MAX_VALUES_ZERO,
RING_BUF_ERR_INDEX_OUTSIDE_RANGE,
RING_BUF_ERR_NUM_ENTRIES_ZERO,
RING_BUF_ERR_DEST_INVALID,
RING_BUF_ERR_
} RING_BUF_ERR;

typedef struct Buffer_typ
{ unsigned long Data;
unsigned long DataSize;
signed short TopIndex;
unsigned short MaxValues;
unsigned short NumberValues;
} Buffer_typ;



/* Prototyping of functions and function blocks */
_BUR_PUBLIC unsigned short BufferCopyItems(unsigned long Buffer, unsigned short Offset, unsigned short NumEntries, unsigned long Destination, unsigned long Status);
_BUR_PUBLIC unsigned long BufferGetItemAdr(unsigned long Buffer, unsigned short Offset, unsigned long Status);
_BUR_PUBLIC unsigned short BufferAddToBottom(unsigned long Buffer, unsigned long Data);
_BUR_PUBLIC unsigned short BufferAddToTop(unsigned long Buffer, unsigned long Data);
_BUR_PUBLIC unsigned short BufferRemoveBottom(unsigned long Buffer);
_BUR_PUBLIC unsigned short BufferRemoveTop(unsigned long Buffer);
_BUR_PUBLIC unsigned short BufferRemoveOffset(unsigned long Buffer, unsigned short Offset, unsigned long Status);
_BUR_PUBLIC unsigned short BufferBottom(unsigned long Buffer);
_BUR_PUBLIC unsigned short BufferInit(unsigned long Buffer, unsigned short MaxValues, unsigned long DataSize);
_BUR_PUBLIC unsigned short BufferDestroy(unsigned long Buffer);
_BUR_PUBLIC unsigned short BufferClear(unsigned long Buffer);
_BUR_PUBLIC plcbit BufferFull(unsigned long Buffer);
_BUR_PUBLIC plcbit BufferValid(unsigned long Buffer);
_BUR_PUBLIC unsigned short BufferStatus(unsigned long Buffer);
_BUR_PUBLIC unsigned short GetTopIndex(unsigned long Buffer);
_BUR_PUBLIC unsigned short GetBottomIndex(unsigned long Buffer);
_BUR_PUBLIC unsigned long GetNextBottomIndex(unsigned long Buffer);
_BUR_PUBLIC plcbit SetStatusPointer(unsigned long pStatus, unsigned short Status);
_BUR_PUBLIC unsigned long GetNextTopIndex(unsigned long Buffer);


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

Expand Down
Loading
Loading