forked from AysherInc/Arelle
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (144 loc) · 5.29 KB
/
build-and-release-linux.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
139
140
141
142
143
144
145
146
147
name: Build and Release Linux
on:
workflow_dispatch:
inputs:
edgar_renderer_ref:
description: 'Arelle/EdgarRenderer branch, tag or SHA to checkout (blank for default)'
required: false
type: string
ixbrl_viewer_ref:
description: 'Workiva/ixbrl-viewer branch, tag or SHA to checkout (blank for default)'
required: false
type: string
openssl_version:
default: '1.1.1s'
description: 'OpenSSL version to use'
required: true
type: string
node_version:
default: '19'
description: 'Node.js version to use'
required: true
type: string
python_version:
default: '3.11.2'
description: 'Python version to use'
required: true
type: string
xule_ref:
description: 'xbrlus/xule branch, tag or SHA to checkout (blank for default)'
required: false
type: string
jobs:
build-linux:
environment: release
runs-on: ubuntu-22.04
strategy:
matrix:
distro: [
ubuntu
]
steps:
- name: Checkout arelle
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Checkout EdgarRenderer
uses: actions/[email protected]
with:
repository: Arelle/EdgarRenderer
path: arelle/plugin/EdgarRenderer
ref: ${{ inputs.edgar_renderer_ref }}
- name: Cleanup EdgarRenderer
run: rm -rf arelle/plugin/EdgarRenderer/.git
- name: Checkout XULE
uses: actions/[email protected]
with:
repository: xbrlus/xule
path: xule
ref: ${{ inputs.xule_ref }}
- name: Move XULE plugins
run: |
mv xule/plugin/validate/* arelle/plugin/validate/
rm -rf xule/plugin/validate
mv xule/plugin/* arelle/plugin/
- name: Cleanup XULE
run: rm -rf xule
- name: Checkout ixbrl-viewer
uses: actions/[email protected]
with:
fetch-depth: 0
repository: Workiva/ixbrl-viewer
path: ixbrl-viewer
ref: ${{ inputs.ixbrl_viewer_ref }}
- name: Set up Node JS
uses: actions/[email protected]
with:
node-version: ${{ inputs.node_version }}
- name: Build ixbrl-viewer
working-directory: ixbrl-viewer
run: |
npm install
make prod
- name: Move ixbrl-viewer plugin
run: mv ixbrl-viewer/iXBRLViewerPlugin arelle/plugin/
- name: Cleanup ixbrl-viewer
run: rm -rf ixbrl-viewer
- name: Docker setup buildx
uses: docker/[email protected]
- name: Docker build
uses: docker/[email protected]
with:
build-args: |
"OPENSSL_VERSION=${{ inputs.openssl_version }}"
"PYTHON_VERSION=${{ inputs.python_version }}"
context: .
file: docker/${{ matrix.distro }}.Dockerfile
load: true
tags: arelle:arelle
- name: Docker copy build artifact
run: |
docker create --name arelle arelle:arelle
docker cp arelle:/build/dist/ dist/
docker rm -v arelle
- name: Capture build env
run: |
[[ $(echo dist/*.tgz) =~ -([0-9]+\.[0-9]+\.[0-9]+)\.tgz$ ]] && echo "ARTIFACT_VERSIONED_NAME=arelle-${{ matrix.distro }}-${BASH_REMATCH[1]}.tgz" >> $GITHUB_ENV
echo "ARTIFACT_NAME=arelle-${{ matrix.distro }}.tgz" >> $GITHUB_ENV
echo "BUILD_ARTIFACT_PATH=$(echo dist/*.tgz)" >> $GITHUB_ENV
- name: Upload build artifact
uses: actions/[email protected]
with:
name: ${{ matrix.distro }} distribution
if-no-files-found: error
path: ${{ env.BUILD_ARTIFACT_PATH }}
- name: Upload release artifact
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/[email protected]
with:
fail_on_unmatched_files: true
files: ${{ env.BUILD_ARTIFACT_PATH }}
- name: Configure AWS Credentials
if: startsWith(github.ref, 'refs/tags/')
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
aws-region: us-west-1
- name: Upload release artifacts to S3
if: startsWith(github.ref, 'refs/tags/')
run: |
aws s3 cp --acl public-read ${{ env.BUILD_ARTIFACT_PATH }} s3://arelle-us/${{ env.ARTIFACT_VERSIONED_NAME }}
aws s3 cp --acl public-read s3://arelle-us/${{ env.ARTIFACT_VERSIONED_NAME }} s3://arelle-us/${{ env.ARTIFACT_NAME }}
- name: Configure Ali Cloud Credentials
if: startsWith(github.ref, 'refs/tags/')
uses: yizhoumo/[email protected]
with:
endpoint: oss-cn-shenzhen.aliyuncs.com
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
- name: Upload release artifacts to Ali Cloud
if: startsWith(github.ref, 'refs/tags/')
run: |
ossutil cp -f ${{ env.BUILD_ARTIFACT_PATH }} oss://arelle-cn/${{ env.ARTIFACT_VERSIONED_NAME }}
ossutil create-symlink oss://arelle-cn/${{ env.ARTIFACT_NAME }} oss://arelle-cn/${{ env.ARTIFACT_VERSIONED_NAME }}