This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
build #124
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 | |
schedule: | |
# Every Saturday at 18:15 | |
- cron: "18 15 * * 6" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install | |
run: | | |
sudo apt-get install -y genisoimage | |
- name: Build | |
run: make build | |
- 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 docker/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: docker/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: docker/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@v3 | |
- 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@v3 | |
- 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 }} |