This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
update #93
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
cache: true | |
go-version: stable | |
- name: Install Task | |
run: go install github.com/go-task/task/v3/cmd/task@latest | |
- name: Install | |
run: sudo apt-get install -y genisoimage | |
- name: Register Subscriptions | |
run: task register-subscription | |
env: | |
REDHAT_ORG: ${{ secrets.REDHAT_ORG }} | |
REDHAT_ACTIVATION_KEY: ${{ secrets.REDHAT_ACTIVATION_KEY }} | |
- name: Build and Extract ISO | |
run: task extract | |
- name: Unregister Subscriptions | |
run: task register-subscription | |
if: always() | |
env: | |
REDHAT_ORG: ${{ secrets.REDHAT_ORG }} | |
REDHAT_ACTIVATION_KEY: ${{ secrets.REDHAT_ACTIVATION_KEY }} | |
- name: Mount ISO | |
run: | | |
echo "--> Prepare ISO" | |
sudo mkdir /mnt/virtio-iso | |
sudo chown $USER:$USER /mnt/virtio-iso | |
sudo chmod 755 /mnt/virtio-iso | |
echo "--> Mounting ISO" | |
sudo mount -o loop build/virtio-win.iso /mnt/virtio-iso | |
- name: Copy files and generate Win-PE ISOs | |
run: ./scripts/ci-copy-files.sh /mnt/virtio-iso | |
- name: Upload virtio-win.iso | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-win.iso | |
path: build/virtio-win.iso | |
retention-days: 7 | |
- name: Upload virtio-win.iso checksum | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-win.iso.sha256 | |
path: build/virtio-win.iso.sha256 | |
retention-days: 7 | |
- name: Upload virtio-win-guest-tools.exe | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-win-guest-tools.exe | |
path: docker/build/virtio-win-guest-tools.exe | |
retention-days: 7 | |
- name: Upload virtio-win-guest-tools.exe checksum | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-win-guest-tools.exe.sha256 | |
path: docker/build/virtio-win-guest-tools.exe.sha256 | |
retention-days: 7 | |
- name: Upload virtio-winpe.iso | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-winpe.iso | |
path: docker/build/virtio-winpe.iso | |
retention-days: 7 | |
- name: Upload virtio-winpe.iso checksum | |
uses: actions/upload-artifact@v3 | |
with: | |
name: virtio-winpe.iso.sha256 | |
path: docker/build/virtio-winpe.iso.sha256 | |
retention-days: 7 | |
- name: Upload VERSION.txt | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VERSION.txt | |
path: docker/build/VERSION.txt | |
retention-days: 7 | |
- name: Files | |
run: | | |
tree -p docker/build/ | |
cat docker/build/VERSION.txt | |
verify: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: powershell | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download VIRTIO ISO | |
uses: actions/download-artifact@v3 | |
with: | |
name: virtio-win.iso | |
- name: Verify | |
run: .\scripts\verify.ps1 -Path ${env:GITHUB_WORKSPACE}\virtio-win.iso | |
# Release if | |
# 1. Latest tag on GitHub differs from extracted version | |
# 2. If on master branch | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
contents: write | |
needs: | |
- build | |
- verify | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download ISO | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-win.iso | |
- name: Download ISO checksum | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-win.iso.sha256 | |
- name: Download winpe ISO | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-winpe.iso | |
- name: Download winpe ISO checksum | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-winpe.iso.sha256 | |
- name: Download virtio-win-guest-tools.exe | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-win-guest-tools.exe | |
- name: Download virtio-win-guest-tools.exe checksum | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: virtio-win-guest-tools.exe.sha256 | |
- name: Download VERSION.txt | |
uses: actions/download-artifact@v3 | |
with: | |
path: docker/build/ | |
name: VERSION.txt | |
- name: Release if necessary | |
run: | | |
ls -alh docker/build | |
./scripts/ci-release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |