Build and release for target platforms #75
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
name: Build and release for target platforms | |
on: [workflow_dispatch] | |
jobs: | |
linux-x86_64-build: | |
name: Linux x86_64 Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [arch, debian, fedora, ubuntu] | |
env: | |
DISTRO: ${{ matrix.distro }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build docker build environment | |
run: docker build -f ci/Linux/$DISTRO/Dockerfile . -t shnootalk-build-env | |
- name: Build compiler | |
run: | | |
docker run -v `pwd`:/home/ -w /home/ shnootalk-build-env:latest \ | |
sh /home/ci/Linux/build.sh llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz | |
- name: Set release file | |
id: set_file | |
run: echo "##[set-output name=files;]$(find bin/ -name '*.tar.gz')" | |
- name: Set release tag | |
id: set_tag | |
run: echo "##[set-output name=tag;]$(cat version)" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.set_file.outputs.files }} | |
tag_name: ${{ steps.set_tag.outputs.tag }} | |
linux-x86_64-appimage: | |
name: Linux x86_64 AppImage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install yq | |
run: | | |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.25.2/yq_linux_amd64 -O /usr/bin/yq | |
sudo chmod +x /usr/bin/yq | |
- name: Set version in appimage recipe | |
run: VERSION=`cat version` yq -i '.AppDir.app_info.version = strenv(VERSION)' ci/Linux/appimage/appimage-x86_64.yml | |
- name: Install AppImage Builder | |
run: | | |
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse | |
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool | |
sudo chmod +x /usr/local/bin/appimagetool | |
sudo pip3 install appimage-builder | |
- name: Build AppImage | |
run: sudo appimage-builder --recipe ci/Linux/appimage/appimage-x86_64.yml --skip-test | |
- name: Set release file | |
id: set_file | |
run: echo "##[set-output name=files;]$(find . -name '*.AppImage')" | |
- name: Set release tag | |
id: set_tag | |
run: echo "##[set-output name=tag;]$(cat version)" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.set_file.outputs.files }} | |
tag_name: ${{ steps.set_tag.outputs.tag }} | |
raspberry-pi-build: | |
name: RaspberryPi | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- docker: linux/arm/v7 | |
llvm: clang+llvm-12.0.1-armv7a-linux-gnueabihf.tar.xz | |
- docker: linux/arm64 | |
llvm: clang+llvm-12.0.1-aarch64-linux-gnu.tar.xz | |
env: | |
ARCH: ${{ matrix.arch.docker }} | |
LLVM_ZIP: ${{ matrix.arch.llvm }} | |
steps: | |
- name: Install qemu | |
run: sudo apt install qemu-system binfmt-support qemu-user qemu-user-static | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build docker build environment | |
run: docker buildx build --platform $ARCH -f ci/Linux/debian/Dockerfile . -t shnootalk-build-env | |
- name: Build | |
run: | | |
docker run -v `pwd`:/home/ -w /home/ shnootalk-build-env:latest sh /home/ci/Linux/build.sh llvmorg-12.0.1/$LLVM_ZIP | |
- name: Set release file | |
id: set_file | |
run: echo "##[set-output name=files;]$(find bin/ -name '*.tar.gz')" | |
- name: Set release tag | |
id: set_tag | |
run: echo "##[set-output name=tag;]$(cat version)" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.set_file.outputs.files }} | |
tag_name: ${{ steps.set_tag.outputs.tag }} | |
stdlib: | |
name: Standard library | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set release file | |
id: set_file | |
run: echo "##[set-output name=files;]$(echo shnootalk-stdlib-`cat version`.tar.gz)" | |
- name: Create stdlib tar.gz | |
run: tar cvzf ${{ steps.set_file.outputs.files }} --strip-components=1 stdlib/stdlib | |
- name: Set release tag | |
id: set_tag | |
run: echo "##[set-output name=tag;]$(cat version)" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.set_file.outputs.files }} | |
tag_name: ${{ steps.set_tag.outputs.tag }} |