Skip to content

release-deploy

release-deploy #5

name: release-deploy
on:
workflow_run:
workflows: ["push-build-test-lint-release"]
types:
- completed
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move docs to website dir
run: mv artifacts/common/html github-pages
- name: Clean packages
run: |
rm -rf artifacts/*/_CPack_Packages
mv artifacts/common . || true
- name: Create CHANGELOG
run: |
git log $(git rev-list --tags --skip=1 --max-count=1 | xargs git describe --tags --abbrev=0)..$(git describe --tags --abbrev=0) \
--pretty=format:"* %h - %s (%an, %ar)" > CHANGELOG.md
- name: Package GitHub Page content
working-directory: ${{ github.workspace }}/github-pages
run: |
cmake -E make_directory ${{ runner.temp }}/page-packages
cmake -E tar c ${{ runner.temp }}/page-packages/github-pages.tar -- .
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/*/*
body_path: ./CHANGELOG.md
- uses: actions/upload-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/page-packages/*
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4