Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support riscos build service #16

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
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
118 changes: 118 additions & 0 deletions .github/workflows/robuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
# RISC OS CI build through build.riscos.online
#
# To reuse this configuration with your own repository:
#
# - Create a .robuild.yaml to describe what should be built on RISC OS.
# - `jobs.build.script` should be a list of commands to run on RISC OS
# - `jobs.build.artifacts.path` should be the directory to zip.
# - Create a VersionNum file if you wish to use the automated versioning
# in the same style as the RISC OS sources. [optional]
# - Update the 3rd step ('give the archive a versioned name') to give a
# suitable name for the archive.
# - Update the 4th step ('upload-artifacts') to include the same names.
#
# The 'release' job is triggered when a tag starting with a 'v' is created,
# which will create a GitHub release for the repository with the name of the
# version tag. The release will be a draft, and should be updated with
# changes as you see fit.
#

name: RISC OS

# Controls when the action will run. Triggers the workflow on:
# * push on any branch.
# * tag creation for tags beginning with a 'v'
on:
push:
tags: ["v*"]
# Pull request events happen on pull request state transitions, and also when the PR is created.
pull_request:
branches: ["*"]

jobs:
build-riscos:
# The type of runner that the job will run on
runs-on: ubuntu-latest

outputs:
version: ${{ steps.version.outputs.version }}
leafname: ${{ steps.version.outputs.leafname }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Obtain prerequisite build tool
run: |
# Fetch the build client
curl -s -L -o riscos-build-online https://github.com/gerph/robuild-client/releases/download/v0.05/riscos-build-online && chmod +x riscos-build-online

- name: Build through build.riscos.online
run: |
# Zip up the source to send to robuild
zip -q9r /tmp/source-archive.zip * .robuild.yaml
# Send the archive file to build service (timeout of 60 seconds)
./riscos-build-online -i /tmp/source-archive.zip -a off -t 60 -o /tmp/built

- name: Give the output a versioned name
id: version
run: |
if [[ -f src/VersionNum ]] ; then
version=$(sed '/MajorVersion / ! d ; s/.*MajorVersion *"\(.*\)"/\1/' src/VersionNum)
else
version=$(git rev-parse --short HEAD)
fi
echo "This is version: $version"
leafname="WakeOnLAN-$version.zip"
if [ -f /tmp/built,a91 ] ; then
cp /tmp/built,a91 "WakeOnLAN-$version.zip"
else
echo "No archive was built?"
exit 1
fi
echo "::set-output name=version::$version"
echo "::set-output name=leafname::$leafname"

- uses: actions/upload-artifact@v2
with:
name: RISCOS-build
path: ${{ steps.version.outputs.leafname }}
# The artifact that is downloadable from the Actions is actually a zip of the artifacts
# that we supply. So it will be a regular Zip file containing a RISC OS Zip file.

# The release only triggers when the thing that was pushed was a tag starting with 'v'
release:
needs: build-riscos
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download built binary
uses: actions/download-artifact@v1
with:
name: RISCOS-build

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ needs.build-riscos.outputs.version }}
draft: true
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: RISCOS-build/${{ needs.build-riscos.outputs.leafname }}
asset_name: ${{ needs.build-riscos.outputs.leafname }}
asset_content_type: application/zip
33 changes: 33 additions & 0 deletions .robuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%YAML 1.0
---

# RISC OS Build service build file
# How to build manually on a non-RISC OS system:
# rm -f /tmp/source-archive.zip ; zip -9r /tmp/source-archive.zip .robuild.yaml src LICENSE ; riscos-build-online -i /tmp/source-archive.zip -o /tmp/built and unzip -l /tmp/built,a91

# Defines a list of jobs which will be performed.
# Only 1 job will currently be executed.
jobs:
build:
# Env defines system variables which will be used within the environment.
# Multiple variables may be assigned.
env:
"Sys$Environment": ROBuild
"BUILD32": 1
"Locale": UK

# Directory to change to before running script
dir: src

# Commands which should be executed to perform the build.
# The build will terminate if any command returns a non-0 return code or an error.
script:
- /MkROBuild

# Outputs from the build are defined in artifacts
# These are a list of artifacts to report directories or files.
# Only a single item is currently supported.
artifacts:
# Each element of the artifacts should have a path key, which gives the file or
# directory to return.
- path: Artifacts
47 changes: 47 additions & 0 deletions src/MakefileROBuild,fe1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env riscos-amu -f
# Makefile for WakeOnLan
#

#
# Program specific options:
#
COMPONENT = WakeOnLan

# Specifies additional targets for startup
#INITTARGET = inittarget

# Specifies additional targets for clean
#CLEANTARGET = cleantarget

# aif, for linked objects
# aof, for a partially linked AOF object
# util, for utilities built with objasm
# basic, for BASIC tools
TYPE = aif

# The file to output (defaults ${COMPONENT})
#TARGET = <filename>

# Comma-separated list of paths to use for includes, such as:
# <Lib$Dir>.LibName.
INCLUDES = TCPIPLibs:

# Space separated list of defines to set, eg -DDEBUG
CDEFINES =

# Space separated list of libraries to link against.
LIBS = ${CLIB} ${TCPIPLIBS}

# Objects to build, using the format o.<name> (will be varied for build type)
OBJS = o.magic \
o.main \

# Space separated list of XML files for building documentation.
#DOCSRC = <prm-in-xml-sources>


include LibraryCommand


#---------------------------------------------------------------------------
# Dynamic dependencies:
12 changes: 12 additions & 0 deletions src/MkROBuild,feb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
| Build on the RISC OS Build service

Dir <Obey$Dir>
cdir ^.Artifacts
cdir ^.Artifacts.Library
cdir ^.Artifacts.Library.Internet
amu -f MakeFileROBuild install INSTDIR=^.Artifacts.Library.Internet
if "<Sys$ReturnCode>" <> 0 Then Error Failed to build

| Two LICENSE files are present, so must be supplied to the user.
copy LICENSE ^.Artifacts.LICENSE/1 ~CVF
copy ^.LICENSE ^.Artifacts.LICENSE/2 ~CVF
3 changes: 3 additions & 0 deletions src/Resources/UK/Help
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WakeOnLAN {Module_FullVersionAndDate}
*WakeOnLAN is used to send a magic network packet to a machine to cause it to wake up. The remote machine must be configured to accept such network packets.
Syntax: *WakeOnLAN -m <mac address> [ -b <broadcast address> ] [-v]
24 changes: 24 additions & 0 deletions src/VersionNum
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* WakeOnLAN (0.02) 01:13:55 12/12/2022
*
* This file is automatically maintained by vmanage, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.02
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Dec 2022

#define Module_MajorVersion "0.02"
#define Module_Version 2
#define Module_MinorVersion ""
#define Module_Date "12 Dec 2022"

#define Module_ApplicationDate2 "12-Dec-22"
#define Module_ApplicationDate4 "12-Dec-2022"

#define Module_ComponentName "WakeOnLAN"
#define Module_ComponentBranch ""
#define Module_ComponentPath "WakeOnLAN"

#define Module_FullVersion "0.02"
#define Module_FullVersionAndDate "0.02 (12 Dec 2022)"
#define Module_HelpVersion "0.02 (12 Dec 2022)"
Loading