-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (94 loc) · 3.22 KB
/
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
---
name: release
run-name: release-${{ github.ref_name }}
on:
workflow_dispatch:
release:
types:
- published
env:
gap-branch: stable-4.13
revision: ${{ github.event.repository.name }}-${{ github.ref_name }}
archive-file: ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz
jobs:
assets-build:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: git -- checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: gap-actions/setup-gap@v2
with:
GAPBRANCH: ${{ env.gap-branch }}
- name: gap -- build docs
uses: gap-actions/build-pkg-docs@v1
with:
use-latex: 'true'
- name: github -- run clean up for tarball
run: |
echo "::group:: cleanup version control metadata"
rm -rvf .git
rm -rvf .svn
echo "::group:: cleanup deployment metadata"
rm -rvf .github
rm -fv .codecov.yaml
rm -fv .codecov.yml
rm -fv .gaplint.yml
rm -fv requirements.txt
echo "::group:: cleanup macos metadata"
find . -name .DS_Store -exec rm -f {} +
echo "::group:: remove tex aux files"
find doc \( -name '*.aux' -o -name '*.bbl' -o -name '*.blg' -o -name '*.brf' -o -name '*.idx' -o -name '*.ilg' -o -name '*.ind' -o -name '*.log' -o -name '*.out' -o -name '*.pnr' -o -name '*.toc' -o -name '*.tst' \) -exec rm -f {} +
- name: pkg -- build an archive
run: |
touch ${{ env.archive-file }}
tar -czf ${{ env.archive-file }} --exclude=${{ env.archive-file }} --transform 's,^\.,${{ env.revision }},' .
- name: github -- upload artifacts
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.archive-file }}
doc/manual.pdf
update-website:
runs-on: ubuntu-22.04
needs: assets-build
permissions:
contents: write
steps:
- uses: gap-actions/setup-gap@v2
with:
GAPBRANCH: ${{ env.gap-branch }}
- name: git -- checkout page
uses: actions/checkout@v4
with:
path: gh-pages
ref: gh-pages
- name: website -- download asset to be deployed
uses: robinraju/release-downloader@v1
with:
tag: ${{ github.ref_name }}
fileName: ${{ env.archive-file }}
- name: website -- extract the archive
run: |
tar -xvf ${{ env.archive-file }}
- name: metadata -- copy metada to update page
run: |
rm -rf ./gh-pages/doc
cp -r ${{ env.revision }}/doc/ ./gh-pages/doc/
cp ${{ env.revision }}/PackageInfo.g ./gh-pages/PackageInfo.g
cp ${{ env.revision }}/README.md ./gh-pages/README.md
rm -fv ./gh-pages/doc/.gitignore
- name: gap -- run update.g
working-directory: ./gh-pages
run: |
gap update.g
- name: git -- commit the update
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[${{ github.ref_name }}] - website update'
repository: gh-pages
branch: gh-pages
push_options: '--force'