-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (87 loc) · 2.92 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
name: Hooktest and Release
on:
push:
# Dispatch when pushing to default branch; currently `main`
branches:
- main
# Dispatch on pull requests
pull_request:
jobs:
run_hooktest:
name: Run Hooktest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup Python
- name: Set up Python 3.11
# > 3.11 breaks hooktest
uses: actions/setup-python@v2
with:
python-version: "3.11"
# Setup Java for Hooktest
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Install Hooktest
run: pip3 install HookTest
- name: Run Hooktest
run: hooktest ./ --console --scheme epidoc --workers 3 --verbose 10 --manifest --countword --allowfailure
# Include manifest.txt as a job artifact so we can re-use it when creating the release.
- name: Export manifest.txt
id: export_manifest
uses: actions/upload-artifact@v3
with:
name: manifest-txt
path: manifest.txt
create_release:
name: Create release
# Only create releases on commits to the default branch; currently `main`.
# We are able to use the event.repository.default_branch variable within the job definition,
# but _not_ in workflow:on definition above.
if: success() && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
needs: run_hooktest
env:
MAJOR_VERSION: 0
MINOR_VERSION: 0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
# Setup Python
- name: Set up Python 3.11
# > 3.11 breaks hooktest
uses: actions/setup-python@v2
with:
python-version: "3.11"
# Setup Java for Hooktest
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Install Hooktest
run: pip3 install HookTest
- name: Restore manifest.txt
id: restore_manifest
uses: actions/download-artifact@v3
with:
name: manifest-txt
- name: Prepare tag
run: |
hooktest-build --travis --txt ./
results=$(cat manifest.txt)
DATE=`date +%Y-%m-%d`
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
export GIT_TAG=$MAJOR_VERSION.$MINOR_VERSION.$GITHUB_RUN_ID
git add -A
git commit -m "Removed failing files" -m "Release $GIT_TAG"
git tag $GIT_TAG -a -m "$DATE" -m "PASSING FILES" -m "$results"
git push -q origin "${GIT_TAG}"
ls -R
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ github.run_id }}