-
Notifications
You must be signed in to change notification settings - Fork 25
129 lines (111 loc) · 3.88 KB
/
pre-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
name: Build, test, and tag
on:
push:
branches: [ develop ]
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ develop, main ]
permissions:
contents: read
jobs:
build:
name: Build Edirom Online
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Get short sha
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Build Edirom Online from ${{ github.ref }} at ${{ github.sha }}
run: docker run --rm -v $(pwd):/app -w /app --entrypoint ./build.sh bwbohl/sencha-cmd
- name: Upload Artifacts to action run
if: github.repository == 'Edirom/Edirom-Online'
uses: actions/upload-artifact@v4
with:
# The name that the artifact will be made available under
name: EdiromOnline_${{ steps.short-sha.outputs.sha }}.zip
# The path to retrieve the artifact
path: ${{ github.workspace }}/build-xar/Edirom-Online-*.xar
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
#optional retention-days: 1 to 90
outputs:
# saving this as output for following jobs to pick up
artifact_name: EdiromOnline_${{ steps.short-sha.outputs.sha }}.zip
check-language-files:
name: Check alignment of language files
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install libsaxonhe-java for XQuery support
run: |
sudo apt-get update
sudo apt-get install libsaxonhe-java
- name: Run test
run: ant -lib /usr/share/java/ check-language-files
xqunit:
name: Run XQSuite unit tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install libxml2-utils for xmllint
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
- name: Download artifact from previous job
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: xars
- name: Create Docker container
run: |
docker create --rm --name edirom-online -p 8080:8080 stadlerpeter/existdb:6
for i in xars/*.xar ; do docker cp $i edirom-online:/opt/exist/autodeploy/ ; done
- name: Run Docker container
run: |
docker start edirom-online
i=0 ; while (! docker inspect edirom-online | grep -e Status....healthy) ; do if ((i > 30)) ; then echo ' **** timeout ... aborting **** ' ; exit 1 ; else sleep 5 ; echo waiting for container ... ; i=$((i+1)) ; fi ; done
- name: Run test suite
run: ant xqunit-tests
- name: Tear down Docker
run: docker kill edirom-online
update-tag:
name: Update git development tag and Github release
needs: [build,xqunit,check-language-files]
if: ${{ github.event_name == 'push' && github.ref_name == 'develop' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Delete dev-release
run: gh release delete dev --cleanup-tag -y
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.event.repository.name }}
- name: Download artifact from previous job
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: xars
- name: Create dev-release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: ${{ github.workspace }}/xars/Edirom-Online-*.xar
commit: ${{ github.sha }}
name: "Development Build"
prerelease: true
replacesArtifacts: true
tag: dev