Skip to content

Commit

Permalink
ci: unify release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Aug 27, 2024
1 parent a20d6e7 commit 99f4608
Showing 1 changed file with 24 additions and 47 deletions.
71 changes: 24 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
steps:
- name: Generate Test Matrix
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: cpp-matrix
with:
compilers: |
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup CMake
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: setup-cmake
with:
version: ${{ matrix.compiler == 'clang' && '3.26' || '>=3.26' }}
Expand All @@ -72,15 +72,15 @@ jobs:
if: ${{ runner.os == 'Windows' }}

- name: Setup C++
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
check-latest: ${{ matrix.compiler == 'clang' }}

- name: Install System Packages
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: package-install
env:
DEBIAN_FRONTEND: 'noninteractive'
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
node-version: '18'

- name: CMake Workflow
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
with:
cmake-version: ${{ matrix.compiler == 'clang' && '3.26' || '>=3.26' }}
cxxstd: ${{ matrix.cxxstd }}
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
retention-days: 1

- name: FlameGraph
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
if: matrix.time-trace
with:
build-dir: build
Expand All @@ -290,28 +290,28 @@ jobs:
gcov: true
verbose: true

website:
releases:
needs: build
defaults:
run:
shell: bash
name: Website
name: Releases
timeout-minutes: 30
runs-on: ubuntu-20.04
container: ubuntu:23.04
permissions:
contents: write
steps:
- name: Setup C++
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: setup-cpp
with:
compiler: clang
version: 16
check-latest: true

- name: Install packages
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: package-install
with:
apt-get: libstdc++-12-dev asciidoctor cmake bzip2 git
Expand All @@ -332,6 +332,11 @@ jobs:
name: release-packages-Linux
path: packages

- uses: actions/download-artifact@v4
with:
name: release-packages-Windows
path: packages

- name: Install MrDocs
run: |
set -x
Expand All @@ -343,7 +348,7 @@ jobs:
echo -e "CXX=$CXX" >> $GITHUB_ENV
- name: Clone Boost.URL
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
id: boost-url-clone
with:
branch: develop
Expand Down Expand Up @@ -530,51 +535,22 @@ jobs:
chmod 755 -R $(pwd)/demos
scp -o StrictHostKeyChecking=no -r $(pwd)/demos/* [email protected]:$demo_dir/
releases:
needs: build
defaults:
run:
shell: bash

name: Releases
timeout-minutes: 120
runs-on: ubuntu-22.04
permissions:
contents: write

steps:
- name: Clone mrdocs
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: release-packages-Linux
path: build

- uses: actions/download-artifact@v4
with:
name: release-packages-Windows
path: build

- name: List artifacts
run: ls -R
working-directory: build
- name: Set Repository Ownership
run: |
git config --global --add safe.directory "$(pwd)"
- name: Create changelog
uses: alandefreitas/cpp-actions/[email protected].3
uses: alandefreitas/cpp-actions/[email protected].4
with:
output-path: CHANGELOG.md
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
github-token: ${{ secrets.GITHUB_TOKEN }}
limit: 150

- name: Compare Markup Templates
run: |
set -x
chmod +x .github/compare_templates.sh
.github/compare_templates.sh
- name: Check info nodes
- name: Check Info Nodes
run: |
set -x
chmod +x .github/check_info_nodes_support.sh
Expand All @@ -584,15 +560,16 @@ jobs:
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
uses: softprops/action-gh-release@v1
with:
files: build/MrDocs-?.?.?-*.*
files: packages/MrDocs-?.?.?-*.*
name: ${{ github.ref_name || github.ref }}
tag_name: ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }}
body_path: CHANGELOG.md
prerelease: false
draft: false
token: ${{ github.token }}

- uses: dev-drprasad/[email protected]
- name: Delete Older Releases
uses: dev-drprasad/[email protected]
if: ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }}
with:
keep_latest: 1
Expand Down

0 comments on commit 99f4608

Please sign in to comment.