This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
update #98
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 build-rhel | |
- name: Unregister Subscriptions | |
run: task unregister-subscription | |
if: always() | |
env: | |
REDHAT_ORG: ${{ secrets.REDHAT_ORG }} | |
REDHAT_ACTIVATION_KEY: ${{ secrets.REDHAT_ACTIVATION_KEY }} | |
- name: Copy ISO and VERSION.text | |
run: | | |
cp --force build/rhel/virtio-win.iso build/virtio-win.iso | |
cp --force build/rhel/VERSION.txt build/VERSION.txt | |
- 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 VERSION.txt | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VERSION.txt | |
path: docker/build/VERSION.txt | |
retention-days: 7 | |
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: build/ | |
name: virtio-win.iso | |
- name: Download VERSION.txt | |
uses: actions/download-artifact@v3 | |
with: | |
path: build/ | |
name: VERSION.txt | |
- 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: Release if necessary | |
run: | | |
ls -alh docker/build | |
./scripts/ci-release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |