|
| 1 | +--- |
| 2 | + |
| 3 | +name: release |
| 4 | +run-name: release-${{ github.ref_name }} |
| 5 | +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 |
| 15 | + |
| 16 | +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 | +
|
| 67 | +
|
| 68 | + update-website: |
| 69 | + runs-on: ubuntu-22.04 |
| 70 | + needs: assets-build |
| 71 | + permissions: |
| 72 | + contents: write |
| 73 | + steps: |
| 74 | + - uses: gap-actions/setup-gap@v2 |
| 75 | + 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 |
| 86 | + 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 |
| 109 | + with: |
| 110 | + commit_message: '[${{ github.ref_name }}] - website update' |
| 111 | + repository: gh-pages |
| 112 | + branch: gh-pages |
| 113 | + push_options: '--force' |
0 commit comments