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: CSVFileLib
LIBRARY_DIR: src/Ar/CSVFileLib
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.
4 changes: 2 additions & 2 deletions example/AsProject/Logical/Libraries/Loupe/Package.pkg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?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\csvfilelib\ANSIC.lby</Object>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\CSVFileLib\ANSIC.lby</Object>
<Object Type="Library" Language="Binary">fiowrap</Object>
<Object Type="Library" Language="Binary">stringext</Object>
<Object Type="Library" Language="Binary">hmitools</Object>
<Object Type="Library" Language="Binary">ringbuflib</Object>
<Object Type="Library" Language="Binary">logthat</Object>
<Object Type="Library" Language="Binary">stringext</Object>
</Objects>
</Package>
12 changes: 5 additions & 7 deletions example/AsProject/Logical/Libraries/Loupe/fiowrap/Binary.lby
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<Library xmlns="http://br-automation.co.at/AS/Library" Version="0.09.1" SubType="Binary">
<Library xmlns="http://br-automation.co.at/AS/Library" Version="1.0.0" SubType="Binary">
<Files>
<File>FIOWrap.html</File>
<File>FIOWrap.md</File>
<File>VersionHistory.txt</File>
<File>CHANGELOG.md</File>
<File Description="Exported data types">FIOWrap.typ</File>
<File Description="Exported constants">FIOWrap.var</File>
<File Description="Exported functions and function blocks">FIOWrap.fun</File>
</Files>
</Files>
<Dependencies>
<Dependency ObjectName="FileIO" />
<Dependency ObjectName="astime" />
<Dependency ObjectName="AsBrStr" />
<Dependency ObjectName="StringExt" FromVersion="0.11.0" />
<Dependency ObjectName="StringExt" FromVersion="1.0.0" />
</Dependencies>
</Library>
</Library>
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.10.1 - Fix done early bug

0.10.0 - Add header parameter that if specified is added to the top on new files

0.9.1 - Migrate from AsString to AsBrStr

0.9.0 - FIOWrap: Add configurable suffix
Expand Down
12 changes: 6 additions & 6 deletions example/AsProject/Logical/Libraries/Loupe/fiowrap/FIOWrap.fun
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(********************************************************************
* COPYRIGHT -- Automation Resources Group
********************************************************************
* Library: FIOWrap
(*
* File: FIOWrap.fun
* Author: blackburnd
* Created: June 18, 2009
* Copyright (c) 2023 Loupe
* https://loupe.team
*
* This file is part of FIOWrap, licensed under the MIT License.
*
********************************************************************
* Functions and function blocks of library FIOWrap
********************************************************************)
Expand Down
Loading
Loading