-
Notifications
You must be signed in to change notification settings - Fork 39
135 lines (111 loc) · 3.07 KB
/
build-release.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
---
name: Build release
on: # yamllint disable-line rule:truthy
push:
tags:
- '*'
workflow_dispatch:
env:
HLJS_VERSION: 11.9.0
PAKO_VERSION: 2.1.0
jobs:
build-hljs:
name: Build dependencies
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
with:
repository: 'highlightjs/highlight.js'
ref: "v$HLJS_VERSION"
- name: Custom build Highlight.js
run: |
node tools/build.js xml properties http
- name: 'Upload Hightlight.js build'
uses: actions/upload-artifact@v4
with:
name: hljs
path: build/highlight.min.js
retention-days: 1
build-pako:
name: Build dependencies
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
with:
repository: 'nodeca/pako'
ref: $PAKO_VERSION
- name: Custom build Pako
run: |
npx npm-check-updates -u
# Make sure the lock-file is up to date before we run clean-install
npm install --package-lock-only
npm clean-install
npm audit fix
npm run build
- name: 'Upload Pako build'
uses: actions/upload-artifact@v4
with:
name: pako
path: build/pako.js
retention-days: 1
build:
name: Build release
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SAMLTRACER_BUILD_TOKEN }}
ref: ${{ github.head_ref || github.ref_name }}
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Fetch changes
# Without fetching, we might miss new tags due to caching in Github Actions
run: git fetch --all
- uses: actions/download-artifact@v4
with:
name: hljs
path: lib/
- uses: actions/download-artifact@v4
with:
name: pako
path: lib/
- uses: geekyeggo/delete-artifact@v4
with:
name: |
hljs
pako
# Store the version, stripping any v-prefix
- name: Write release version
run: |
TAG="${{ github.ref_name }}"
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
- name: Clean release
run: |
grep export-ignore .gitattributes | cut -d ' ' -f 1 | while IFS= read -r line
do
rm -rf "$line"
done
rm -rf .git
- name: Build release
run: |
zip -r /tmp/samltracer.zip *
- name: Save release
uses: actions/upload-artifact@v4
with:
name: release
path: "/tmp/samltracer.zip"
retention-days: 1
- name: Calculate SHA checksum
run: sha256sum "/tmp/samltracer.zip"