Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Aug 28, 2024
1 parent 437a0dd commit e34b6d4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
#!/bin/bash
url="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/"
resp=$(curl -sS $url)
latest_tag=$(echo "$resp" | grep -o 'href="[^"]*' | tail -c +98 | sed 's/...$//')
latest_tag=$(echo "$resp" | grep -o 'href="[^"]*' | tail -c +98 | cut -f1 -d"/")
[ -z "$latest_tag" ] && echo "Tag not found!" && exit 1
[[ "$latest_tag" = v* ]] && latest_tag="${latest_tag:1}"
echo "Found tag: \"${latest_tag}\""
Expand All @@ -43,8 +43,7 @@ jobs:
echo "exists=true" >> $GITHUB_ENV
exit 0
fi
loc="${{ env.latest_tag }}"
url="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${loc}-1"
url="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${{ env.latest_tag }}"
echo "Checking if ${url} exists.."
resp=$(curl -I 2>/dev/null $url | head -1)
if echo $resp | grep 404 >/dev/null; then
Expand All @@ -59,7 +58,9 @@ jobs:
run: |
#!/bin/bash
sudo apt install genisoimage libarchive-tools
url="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${{ env.latest_tag }}-1/virtio-win-${{ env.latest_tag }}.iso"
base=$(echo "${{ env.latest_tag }}" | cut -f1 -d"-")
echo "latest_base=$base" >> $GITHUB_ENV
url="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${{ env.latest_tag }}/virtio-win-$base.iso"
wget "$url" -O "/tmp/latest.iso" -q
rm -rf /tmp/iso && mkdir /tmp/iso
bsdtar -xf "/tmp/latest.iso" -C /tmp/iso/
Expand Down Expand Up @@ -100,11 +101,11 @@ jobs:
run: |
#!/bin/bash
cd /tmp/iso
tar -C /tmp/iso -cvzf /tmp/virtio-win-${{ env.latest_tag }}.tar.gz * >/dev/null
tar -C /tmp/iso -cvzf /tmp/virtio-win-${{ env.latest_base }}.tar.gz * >/dev/null
echo & echo
XZ_OPT=-9 tar -C /tmp/iso -Jcvf /tmp/virtio-win-${{ env.latest_tag }}.tar.xz * >/dev/null
XZ_OPT=-9 tar -C /tmp/iso -Jcvf /tmp/virtio-win-${{ env.latest_base }}.tar.xz * >/dev/null
echo & echo
genisoimage -o /tmp/virtio-win-${{ env.latest_tag }}.iso -r -iso-level 4 -input-charset iso8859-1 -V "virtio-win-${{ env.latest_tag }}" /tmp/iso
genisoimage -o /tmp/virtio-win-${{ env.latest_base }}.iso -r -iso-level 4 -input-charset iso8859-1 -V "virtio-win-${{ env.latest_base }}" /tmp/iso
-
name: Checkout
if: env.exists == 'false'
Expand All @@ -117,14 +118,14 @@ jobs:
uses: action-pack/github-release@v2
with:
tag: "v${{ env.latest_tag }}"
title: "v${{ env.latest_tag }}"
title: "v${{ env.latest_base }}"
token: ${{ secrets.REPO_ACCESS_TOKEN }}
-
name: Update release
if: env.exists == 'false'
uses: AButler/upload-release-assets@v3.0
with:
files: '/tmp/virtio-win-${{ env.latest_tag }}.*'
files: '/tmp/virtio-win-${{ env.latest_base }}.*'
release-tag: "v${{ env.latest_tag }}"
repo-token: ${{ secrets.REPO_ACCESS_TOKEN }}
-
Expand Down

0 comments on commit e34b6d4

Please sign in to comment.