Skip to content

Create release

Create release #99

Workflow file for this run

# SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers [email protected]
# SPDX-License-Identifier: CC0-1.0
name: Create release
on:
workflow_dispatch:
inputs:
releaseTag:
description: 'Release version'
required: true
env:
MKDOCSOFFLINE: true
NEWVERSION: ${{ github.event.inputs.releaseTag }}
jobs:
Run:
runs-on: ubuntu-latest
container:
image: ikarusproject/ikarus-dev:latest
options: --memory-swap="20g" --memory="20g" --cpus="2" --user root
steps:
- uses: actions/checkout@v4
with:
path: 'repo'
token: ${{ secrets.ORGANIZATION_TOKEN }}
fetch-depth: '0'
- name: Create tag and push tag
run: |
cd repo
python .github/workflows/scripts/release.py $NEWVERSION
git config --local user.email "[email protected]"
git config --local user.name "AlexanderMueller"
git remote set-url origin https://${{ secrets.ORGANIZATION_TOKEN }}@github.com/ikarus-project/ikarus.git
git add .
git commit -m "Create release v$NEWVERSION"
git tag -a v$NEWVERSION -m "Create release v$NEWVERSION"
- name: Docker Login
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Setup Mkdocs
run: |
pip install mkdocs mkdocs-macros-plugin mkdocs-drawio-exporter mkdocs-bibtex mike mkdocs-glightbox pillow cairosvg
pip install git+https://${{ secrets.MKDOCS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
apt-get update && apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- name: Build Doxygen
run: |
git clone https://github.com/jothepro/doxygen-awesome-css.git
cd doxygen-awesome-css
make install
apt-get install -y texlive-base
cd ..
cd repo
mkdir build_docs
cd build_docs
cmake .. -DBUILD_DOCS=1 -DDUNE_ENABLE_PYTHONBINDINGS=0
cmake --build . --target doxygen_ikarus
- name: Build Website
run: |
git clone https://github.com/ikarus-project/ikarus-project.github.io.git
cd ikarus-project.github.io
git fetch origin gh-pages --depth=1
cp -R ../repo/build_docs/ .
cp -R ../repo/ikarus/ .
git config --local user.email "[email protected]"
git config --local user.name "AlexanderMueller"
cd build_docs/docs
export MKDOCSOFFLINE=false
mike deploy v$NEWVERSION --config-file mkdocs.insiders.yml
mike deploy dev --config-file mkdocs.insiders.yml
git remote set-url origin https://${{ secrets.ORGANIZATION_TOKEN }}@github.com/ikarus-project/ikarus-project.github.io.git
git push origin gh-pages
export MKDOCSOFFLINE=true
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Build Website for offline use
run: |
cd ./repo/
mkdir build_docs_offline
cd build_docs_offline
cmake .. -DBUILD_DOCS=1 -DDUNE_ENABLE_PYTHONBINDINGS=0
cmake --build . --target site
mv docs/site documentation-v$NEWVERSION
apt-get update && apt-get install -y tar gzip zip unzip bzip2
tar -czf docs-v$NEWVERSION.tar.gz ./documentation-v$NEWVERSION
zip -9r docs-v$NEWVERSION.zip ./documentation-v$NEWVERSION
- name: Install docker in Docker container
run: |
apt-get update
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- name: Download, tag, push and save docker images for new release
run: |
docker pull ikarusproject/ikarus-dev:latest
docker tag ikarusproject/ikarus-dev:latest ikarusproject/ikarus-dev:v$NEWVERSION
docker pull ikarusproject/ikarus-dev-gcc:latest
docker tag ikarusproject/ikarus-dev-gcc:latest ikarusproject/ikarus-dev-gcc:v$NEWVERSION
docker pull ikarusproject/ikarus-dev-clang:latest
docker tag ikarusproject/ikarus-dev-clang:latest ikarusproject/ikarus-dev-clang:v$NEWVERSION
docker pull ikarusproject/ikarus:latest
docker tag ikarusproject/ikarus:latest ikarusproject/ikarus:v$NEWVERSION
docker pull ikarusproject/ikarus-gcc:latest
docker tag ikarusproject/ikarus-gcc:latest ikarusproject/ikarus-gcc:v$NEWVERSION
docker pull ikarusproject/ikarus-clang:latest
docker tag ikarusproject/ikarus-clang:latest ikarusproject/ikarus-clang:v$NEWVERSION
docker save ikarusproject/ikarus-dev:v$NEWVERSION > ikarus-dev-docker-v$NEWVERSION.tar
docker save ikarusproject/ikarus:v$NEWVERSION > ikarus-docker-v$NEWVERSION.tar
gzip -c9 ikarus-dev-docker-v$NEWVERSION.tar > ikarus-dev-docker-v$NEWVERSION.tar.gz
gzip -c9 ikarus-docker-v$NEWVERSION.tar > ikarus-docker-v$NEWVERSION.tar.gz
- name: Checkout ikarus-examples and create tag, push it, zip it
run: |
git clone https://github.com/ikarus-project/ikarus-examples.git
cd ikarus-examples
git config --local user.email "[email protected]"
git config --local user.name "AlexanderMueller"
git tag -a v$NEWVERSION -m "Create release v$NEWVERSION"
cd ..
mv ikarus-examples ikarus-examples-v$NEWVERSION
tar -czf ikarus-examples-v$NEWVERSION.tar.gz ./ikarus-examples-v$NEWVERSION
zip -9r ikarus-examples-v$NEWVERSION.zip ./ikarus-examples-v$NEWVERSION
- name: Push and finalize
run: |
cd ikarus-project.github.io
git push origin gh-pages
cd ../ikarus-examples-v$NEWVERSION
git push https://${{ secrets.ORGANIZATION_TOKEN }}@github.com/ikarus-project/ikarus-examples.git v$NEWVERSION
cd ..
docker push ikarusproject/ikarus-dev:v$NEWVERSION
docker push ikarusproject/ikarus-dev-gcc:v$NEWVERSION
docker push ikarusproject/ikarus-dev-clang:v$NEWVERSION
docker push ikarusproject/ikarus:v$NEWVERSION
docker push ikarusproject/ikarus-gcc:v$NEWVERSION
docker push ikarusproject/ikarus-clang:v$NEWVERSION
cd repo
git push origin main
git push origin v$NEWVERSION
git pull
sleep 20
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.ORGANIZATION_TOKEN }}"
draft: true
prerelease: true
title: ${{ github.event.inputs.releaseTag }}
files: |
./repo/build_docs_offline/docs-v${{ github.event.inputs.releaseTag }}.tar.gz
./repo/build_docs_offline/docs-v${{ github.event.inputs.releaseTag }}.zip
ikarus-dev-docker-v${{ github.event.inputs.releaseTag }}.tar.gz
ikarus-docker-v${{ github.event.inputs.releaseTag }}.tar.gz
ikarus-examples-v${{ github.event.inputs.releaseTag }}.tar.gz
ikarus-examples-v${{ github.event.inputs.releaseTag }}.zip