Skip to content

Commit ff78837

Browse files
committed
Switch to new release automation
1 parent 5f0e1da commit ff78837

File tree

1 file changed

+27
-103
lines changed

1 file changed

+27
-103
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,37 @@
1-
---
1+
name: Release
22

3-
name: release
4-
run-name: release-${{ github.ref_name }}
53
on:
6-
workflow_dispatch:
7-
release:
8-
types:
9-
- published
10-
11-
env:
12-
gap-branch: stable-4.13
13-
revision: ${{ github.event.repository.name }}-${{ github.ref_name }}
14-
archive-file: ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz
4+
workflow_dispatch:
5+
inputs:
6+
dry-run:
7+
description: "Set to true to create an archive containing the release instead of publishing it on GitHub"
8+
type: boolean
9+
required: false
10+
default: false
11+
force:
12+
description: "Set to true to allow this action to overwrite an existing release, and to make a release with an incorrect date"
13+
type: boolean
14+
required: false
15+
default: false
16+
17+
permissions: write-all
1518

1619
jobs:
17-
assets-build:
18-
runs-on: ubuntu-22.04
19-
permissions:
20-
contents: write
21-
steps:
22-
- name: git -- checkout repository
23-
uses: actions/checkout@v4
24-
with:
25-
ref: ${{ github.ref_name }}
26-
27-
- uses: gap-actions/setup-gap@v2
28-
with:
29-
GAPBRANCH: ${{ env.gap-branch }}
30-
31-
- name: gap -- build docs
32-
uses: gap-actions/build-pkg-docs@v1
33-
with:
34-
use-latex: 'true'
35-
36-
- name: github -- run clean up for tarball
37-
run: |
38-
echo "::group:: cleanup version control metadata"
39-
rm -rvf .git
40-
rm -rvf .svn
41-
42-
echo "::group:: cleanup deployment metadata"
43-
rm -rvf .github
44-
rm -fv .codecov.yaml
45-
rm -fv .codecov.yml
46-
rm -fv .gaplint.yml
47-
rm -fv requirements.txt
48-
49-
echo "::group:: cleanup macos metadata"
50-
find . -name .DS_Store -exec rm -f {} +
51-
52-
echo "::group:: remove tex aux files"
53-
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 {} +
54-
55-
- name: pkg -- build an archive
56-
run: |
57-
touch ${{ env.archive-file }}
58-
tar -czf ${{ env.archive-file }} --exclude=${{ env.archive-file }} --transform 's,^\.,${{ env.revision }},' .
59-
60-
- name: github -- upload artifacts
61-
uses: softprops/action-gh-release@v2
62-
with:
63-
files: |
64-
${{ env.archive-file }}
65-
doc/manual.pdf
66-
20+
release:
21+
name: "Release the GAP package"
22+
runs-on: ubuntu-latest
6723

68-
update-website:
69-
runs-on: ubuntu-22.04
70-
needs: assets-build
71-
permissions:
72-
contents: write
7324
steps:
25+
- uses: actions/checkout@v5
7426
- uses: gap-actions/setup-gap@v2
7527
with:
76-
GAPBRANCH: ${{ env.gap-branch }}
77-
78-
- name: git -- checkout page
79-
uses: actions/checkout@v4
80-
with:
81-
path: gh-pages
82-
ref: gh-pages
83-
84-
- name: website -- download asset to be deployed
85-
uses: robinraju/release-downloader@v1
28+
GAP_PKGS_TO_BUILD: json
29+
- uses: gap-actions/build-pkg-docs@v1
8630
with:
87-
tag: ${{ github.ref_name }}
88-
fileName: ${{ env.archive-file }}
89-
90-
- name: website -- extract the archive
91-
run: |
92-
tar -xvf ${{ env.archive-file }}
93-
94-
- name: metadata -- copy metada to update page
95-
run: |
96-
rm -rf ./gh-pages/doc
97-
cp -r ${{ env.revision }}/doc/ ./gh-pages/doc/
98-
cp ${{ env.revision }}/PackageInfo.g ./gh-pages/PackageInfo.g
99-
cp ${{ env.revision }}/README.md ./gh-pages/README.md
100-
rm -fv ./gh-pages/doc/.gitignore
101-
102-
- name: gap -- run update.g
103-
working-directory: ./gh-pages
104-
run: |
105-
gap update.g
106-
107-
- name: git -- commit the update
108-
uses: stefanzweifel/git-auto-commit-action@v5
31+
use-latex: true
32+
- uses: gap-actions/release-pkg@v1
10933
with:
110-
commit_message: '[${{ github.ref_name }}] - website update'
111-
repository: gh-pages
112-
branch: gh-pages
113-
push_options: '--force'
34+
dry-run: ${{ inputs.dry-run }}
35+
force: ${{ inputs.force }}
36+
- uses: gap-actions/update-gh-pages@v1
37+
if: ${{ !inputs.dry-run }}

0 commit comments

Comments
 (0)