-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (118 loc) · 4.7 KB
/
ci.yml
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
# Build of the RISC OS PRM-in-XML staging repository.
#
name: PRMinXML
# Controls when the action will run. Triggers the workflow on:
# * push on any branch.
on:
push:
branches: ["*"]
tags: ["v*"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# 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
with:
fetch-depth: 0
- name: Build it
run: |
# PrinceXML (http://www.princexml.com/) requires a license to be used.
# If the documents produced contain no advertising, and are provided for
# no cost to anyone, and are published on a site that has no cost and has
# no advertising, and providing that a link is provided to the PrinceXML
# site, the non-commercial license can be used (even on a server).
# Consult https://www.princexml.com/purchase/license_faq/ for more details.
#
# These criteria are met by the builds we're creating here, and so we can
# use the non-commercial license.
sudo env PRINCEXML_I_HAVE_A_LICENSE=1 ./build.sh all
- uses: actions/upload-artifact@v2
with:
name: PRMinXML-Staging
path: output
- uses: actions/upload-artifact@v2
with:
name: Build-Logs
path: logs
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./output
# The release only triggers when the thing that was pushed was a tag starting with 'v'
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download built documentation
uses: actions/download-artifact@v1
with:
name: PRMinXML-Staging
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build the zip archive from the documentation
run: |
cd PRMinXML-Staging
zip -9r ../PRMinXML-Staging.zip *
- 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 ${{ github.event.release.tag_name }}
draft: true
prerelease: false
- name: Upload full archive Assets
id: upload-asset-full
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: PRMinXML-Staging.zip
asset_name: PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip
- name: Upload PDF only Asset
id: upload-asset-pdf
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: PRMinXML-Staging/prm/RISCOS_PRM_Staging.pdf
asset_name: PRMinXML-Staging-${{ steps.get_version.outputs.VERSION }}.pdf
asset_content_type: application/pdf
publish:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
#if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2