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: OMJSON
LIBRARY_DIR: src/Ar/OMJSON
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
10 changes: 0 additions & 10 deletions Jenkinsfile

This file was deleted.

7 changes: 5 additions & 2 deletions example/AsProject/AsProject.apj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version="4.12.6.106" WorkingVersion="4.12"?>
<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>
<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.
13 changes: 2 additions & 11 deletions example/AsProject/Logical/Libraries/Loupe/Package.pkg
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio FileVersion="4.9"?>
<?xml version='1.0' encoding='utf-8'?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Library" Language="Binary">vartools</Object>
<Object Type="Library" Language="Binary">databuffer</Object>
<Object Type="Library" Language="Binary">persist</Object>
<Object Type="Library" Language="Binary">csvfilelib</Object>
<Object Type="Library" Language="Binary">fiowrap</Object>
<Object Type="Library" Language="Binary" Description="A new source library">piper</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">websocket</Object>
<Object Type="Library" Language="Binary">tcpcomm</Object>
<Object Type="Library" Language="Binary">stringext</Object>
<Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\OMJSON\ANSIC.lby</Object>
<Object Type="Library" Language="Binary">hammers</Object>
</Objects>
</Package>
</Package>
25 changes: 0 additions & 25 deletions example/AsProject/Logical/Libraries/Loupe/csvfilelib/Binary.lby

This file was deleted.

This file was deleted.

82 changes: 0 additions & 82 deletions example/AsProject/Logical/Libraries/Loupe/csvfilelib/CHANGELOG.md

This file was deleted.

Loading
Loading