Create release #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2022 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 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: 'repo' | |
token: ${{ secrets.ORGANIZATION_TOKEN }} | |
- 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 | |
sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev | |
- 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/docs/ . | |
cp -R ../repo/ikarus/ . | |
git config --local user.email "[email protected]" | |
git config --local user.name "AlexanderMueller" | |
cd 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/docs | |
cmake -B .build | |
cmake --build .build --target site | |
mv site documentation-v$NEWVERSION | |
tar -czf docs-v$NEWVERSION.tar.gz ./documentation-v$NEWVERSION | |
zip -9r docs-v$NEWVERSION.zip ./documentation-v$NEWVERSION | |
- 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 v$NEWVERSION | |
git push origin main | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.ORGANIZATION_TOKEN }}" | |
automatic_release_tag: v${{ github.event.inputs.releaseTag }} | |
draft: true | |
prerelease: true | |
title: ${{ github.event.inputs.releaseTag }} | |
files: | | |
./repo/docs/docs-v${{ github.event.inputs.releaseTag }}.tar.gz | |
./repo/docs/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 |