-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (108 loc) · 4.47 KB
/
Copy pathci.yml
File metadata and controls
118 lines (108 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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 or pull request on any branch.
# * tag creation for tags beginning with a 'v'
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
create:
tags:
- v*
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@v6
# Step intended to be reused in CI pipelines.
- name: Build through build.riscos.online
run: |
set -o pipefail
# Zip up the source to send to robuild
zip -q9r /tmp/source-archive.zip * .robuild.yaml
# 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
# Send the archive file to build service
./riscos-build-online -i /tmp/source-archive.zip -t 60 -o /tmp/built
- name: Give the output a versioned name
id: version
run: |
if [[ -f VersionNum ]] ; then
version=$(sed '/MajorVersion / ! d ; s/.*MajorVersion *"\(.*\)"/\1/' VersionNum)
else
version=$(git rev-parse --short HEAD)
fi
echo "This is version: $version"
leafname="CObey-$version.zip"
if [ -f /tmp/built,a91 ] ; then
cp /tmp/built,a91 "CObey-$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@v7
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@v8
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