diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91fd476..0f84c12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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}\"" @@ -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 @@ -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/ @@ -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' @@ -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 }} -