support cmake #322
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: Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-x86: | |
permissions: write-all | |
name: Publish Image x86 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
BUILDTYPE: ["full","min"] | |
BUILDARCH: ["686","amd64"] | |
container: | |
image: debian:stable | |
options: --privileged | |
volumes: | |
- /dev:/dev | |
steps: | |
- name: Install Packages | |
shell: bash | |
run: | | |
apt-get -qqy update && apt-get -qqy install debootstrap coreutils dosfstools zip pigz fdisk kpartx mount uuid-runtime lvm2 git && git config --global --add safe.directory '*' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Read release.md and use it as a body of new release | |
id: read_release | |
shell: bash | |
run: | | |
r=$(cat ./release.md) | |
r="${r//'%'/'%25'}" | |
r="${r//$'\n'/'%0A'}" | |
r="${r//$'\r'/'%0D'}" | |
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT | |
- name: Build | |
id: build_bootable | |
env: | |
BUILDTYPE: ${{matrix.BUILDTYPE}} | |
BUILDARCH: ${{matrix.BUILDARCH}} | |
shell: bash | |
run: | | |
rm -f ./*.zip | |
bash ./create_image.sh | |
v=$(cat ./versions.txt) | |
v="${v//'%'/'%25'}" | |
v="${v//$'\n'/'%0A'}" | |
v="${v//$'\r'/'%0D'}" | |
echo "VERSIONS=$v" >> $GITHUB_OUTPUT | |
- name: Compress | |
id: compress | |
shell: bash | |
run: | | |
cd ./output | |
ls -altrh | |
basename=$(basename -s .img *.img) | |
zip -r ${basename}.zip ${basename}.* | |
- name: Bump version and push tag | |
id: bump_version | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token | |
WITH_V: true | |
INITIAL_VERSION: 1.0.0 | |
- name: Generate versions | |
id: versions | |
shell: bash | |
run: | | |
echo "release=${{ steps.read_release.outputs.RELEASE_BODY }}" >> $GITHUB_OUTPUT | |
echo "versions=${{ steps.build_bootable.outputs.VERSIONS }}" >> $GITHUB_OUTPUT | |
- name: Upload binaries to release | |
id: release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: ./output/*.zip | |
tag: ${{ steps.bump_version.outputs.new_tag }} | |
overwrite: true | |
body: | | |
${{join(steps.versions.outputs.*, '%0A')}} | |
#build-other: | |
# permissions: write-all | |
# name: Publish Image Other Arch | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# BUILDTYPE: ["full","min"] | |
# BUILDARCH: ["aarch64"] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Build | |
# uses: uraimo/run-on-arch-action@v2 | |
# id: build_bootable | |
# with: | |
# arch: ${{matrix.BUILDARCH}} | |
# distro: ubuntu_latest | |
# # Create an artifacts directory | |
# setup: | | |
# mkdir -p "${PWD}/output" | |
# # Mount the artifacts directory as /artifacts in the container | |
# dockerRunArgs: | | |
# --volume "${PWD}/output:/output" | |
# env: | | |
# BUILDTYPE: ${{matrix.BUILDTYPE}} | |
# BUILDARCH: ${{matrix.BUILDARCH}} | |
# run: | | |
# uname -a | |
# apt-get -qqy update && apt-get -qqy install debootstrap coreutils pigz fdisk kpartx mount uuid-runtime lvm2 git sudo | |
# git config --global --add safe.directory ${PWD} | |
# bash ./create_image.sh | |
# cp -f ./output/* /output/. | |
# - name: Compress | |
# id: compress | |
# run: | | |
# apt-get -qqy update && apt-get -qqy install zip | |
# cd ./output | |
# basename=$(basename -s .img *.img) | |
# zip -r ${basename} * | |
# - name: Bump version and push tag | |
# id: bump_version | |
# uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token | |
# WITH_V: true | |
# - name: Upload binaries to release | |
# id: release | |
# uses: svenstaro/upload-release-action@v2 | |
# with: | |
# repo_token: ${{ secrets.GITHUB_TOKEN }} | |
# file_glob: true | |
# file: ./output/*.zip | |
# tag: ${{ steps.bump_version.outputs.new_tag }} | |
# overwrite: true |