[llvm] 66d755b - workflows: Add GitHub action for automating some release tasks

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 15:43:33 PDT 2022


Author: Tom Stellard
Date: 2022-07-26T15:36:51-07:00
New Revision: 66d755bbf83db8a3967c4647c41c49d57949ba74

URL: https://github.com/llvm/llvm-project/commit/66d755bbf83db8a3967c4647c41c49d57949ba74
DIFF: https://github.com/llvm/llvm-project/commit/66d755bbf83db8a3967c4647c41c49d57949ba74.diff

LOG: workflows: Add GitHub action for automating some release tasks

For each release tag, this action will create a new release on GitHub,
and for each -final tag, this action will build the documentation and
upload it to GitHub.

Reviewed By: hans, kwk

Differential Revision: https://reviews.llvm.org/D99780

Added: 
    .github/workflows/release-tasks.yml

Modified: 
    llvm/utils/release/build-docs.sh

Removed: 
    


################################################################################
diff  --git a/.github/workflows/release-tasks.yml b/.github/workflows/release-tasks.yml
new file mode 100644
index 0000000000000..a87805b878607
--- /dev/null
+++ b/.github/workflows/release-tasks.yml
@@ -0,0 +1,66 @@
+name: Release Task
+
+on:
+  push:
+    tags:
+      # The regex support here is limited, so just match everything that starts with llvmorg- and filter later.
+      - 'llvmorg-*'
+
+jobs:
+  release-tasks:
+    runs-on: ubuntu-latest
+    if: github.repository == 'llvm/llvm-project'
+    steps:
+
+    - name: Validate Tag
+      id: validate-tag
+      run: |
+        test "${{ github.actor }}" = "tstellar"
+        echo "${{ github.ref_name }}" | grep -e '^llvmorg-[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc[0-9]\+\)\?$'
+        release_version=`echo "${{ github.ref_name }}" | sed 's/llvmorg-//g'`
+        echo "::set-output name=release-version::$release_version"
+
+    - name: Install Dependencies
+      run: |
+        sudo apt-get install -y \
+            doxygen \
+            graphviz \
+            python3-github \
+            python3-recommonmark \
+            python3-sphinx \
+            ninja-build \
+            texlive-font-utils
+        pip3 install --user sphinx-markdown-tables
+
+    - name: Checkout LLVM
+      uses: actions/checkout at v3
+
+    - name: Create Release
+      run: |
+         ./llvm/utils/release/./github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} create
+
+    - name: Build Documentation
+      run: |
+        ./llvm/utils/release/build-docs.sh -srcdir llvm
+        ./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files *doxygen*.tar.xz
+
+    - name: Clone www-releases
+      if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
+      uses: actions/checkout at v3
+      with:
+        repository: ${{ github.repository_owner }}/www-releases
+        ref: main
+        fetch-depth: 0
+        path: www-releases
+
+    - name: Upload Release Notes
+      if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
+      run: |
+        mkdir -p ../www-releases/${{ steps.validate-tag.outputs.release-version }}
+        mv ./docs-build/html-export/* ../www-releases/${{ steps.validate-tag.outputs.release-version }}
+        cd ../www-releases
+        git add ${{ steps.validate-tag.outputs.release-version }}
+        git config user.email "llvmbot at llvm.org"
+        git config user.name "llvmbot"
+        git commit -a -m "Add ${{ steps.validate-tag.outputs.release-version }} documentation"
+        git push https://${{ secrets.WWW_RELEASES_TOKEN }}@github.com/${{ github.repository_owner }}/www-releases main:main

diff  --git a/llvm/utils/release/build-docs.sh b/llvm/utils/release/build-docs.sh
index 6d416e4830e64..8863dbe7930f8 100755
--- a/llvm/utils/release/build-docs.sh
+++ b/llvm/utils/release/build-docs.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #===-- build-docs.sh - Tag the LLVM release candidates ---------------------===#
 #
 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.


        


More information about the llvm-commits mailing list