Skip to content

Build LXD-UI with Incus Patches #6

Build LXD-UI with Incus Patches

Build LXD-UI with Incus Patches #6

Workflow file for this run

name: Build LXD-UI with Incus Patches
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y git nodejs npm
- name: Checkout LXD-UI
uses: actions/checkout@v3
with:
repository: canonical/lxd-ui
path: lxd-ui
- name: Checkout Incus
uses: actions/checkout@v3
with:
repository: zabbly/incus
path: incus
- name: Apply Incus Patches
run: |
cd lxd-ui
for patch in ../incus/patches/ui-canonical-*.patch; do
git apply --reject --whitespace=fix $patch
done
sed -i -f "../incus/patches/ui-canonical-renames.sed" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts* src/*/*/*/*/*.ts*
- name: Install and Build LXD-UI
run: |
cd lxd-ui
npm install -g yarn
yarn install
yarn build
- name: Package Build
run: |
cd lxd-ui/build/ui
version=$(date +%Y%m%d)
tar -czvf incus-ui-$version.tar.gz *
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=$(date +%Y%m%d)
release_name="incus-ui-$version"
asset_name="incus-ui-$version.tar.gz"
asset_path="lxd-ui/build/ui/$asset_name"
release_data=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/cmspam/incus-ui/releases \
-d "{\"tag_name\": \"$release_name\", \"name\": \"$release_name\"}")
upload_url=$(echo "$release_data" | jq -r '.upload_url')
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/zip" \
--data-binary "@$asset_path" \
"$upload_url?name=$asset_name"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: incus-ui
path: lxd-ui/build/ui/incus-ui-*.tar.gz