Skip to content

Commit

Permalink
Merge pull request #95 from mkumatag/windows_support
Browse files Browse the repository at this point in the history
Add windows support
  • Loading branch information
ltccci authored Dec 15, 2020
2 parents 8b140e1 + 02f4432 commit 161853b
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
git fetch --tags --force --prune
VERSION=$(git describe --tags --dirty)
STATIC_FLAG='-w -extldflags "-static"'
for platform in darwin/amd64 linux/amd64 linux/ppc64le
for platform in darwin/amd64 linux/amd64 linux/ppc64le windows/amd64
do
os_name=$(echo "$platform" | cut -d "/" -f 1)
arch=$(echo "$platform" | cut -d "/" -f 2)
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
mkdir -p bin
VERSION=${{ steps.get_version.outputs.VERSION }}
STATIC_FLAG='-w -extldflags "-static"'
for platform in darwin/amd64 linux/amd64 linux/ppc64le
for platform in darwin/amd64 linux/amd64 linux/ppc64le windows/amd64
do
os_name=$(echo "$platform" | cut -d "/" -f 1)
arch=$(echo "$platform" | cut -d "/" -f 2)
Expand Down Expand Up @@ -110,6 +110,26 @@ jobs:
asset_name: pvsadm-darwin-amd64.tar.gz
asset_content_type: application/tar+gzip

- name: Upload Windows - amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/windows-amd64/pvsadm
asset_name: pvsadm-windows-amd64
asset_content_type: application/octet-stream

- name: Upload Windows - amd64 - tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pvsadm-windows-amd64.tar.gz
asset_name: pvsadm-windows-amd64.tar.gz
asset_content_type: application/tar+gzip

- name: Upload all
uses: actions/upload-release-asset@v1
env:
Expand Down
2 changes: 2 additions & 0 deletions cmd/image/qcow2ova/prep/chroot.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//+build !windows

package prep

import (
Expand Down
13 changes: 13 additions & 0 deletions cmd/image/qcow2ova/prep/chroot_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package prep

import (
"fmt"
)

func Chroot(path string) error {
return fmt.Errorf("Not supported on windows platform")
}

func ExitChroot() error {
return fmt.Errorf("Not supported on windows platform")
}
2 changes: 2 additions & 0 deletions cmd/image/qcow2ova/validate/diskspace/diskspace.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !windows

package diskspace

import (
Expand Down
20 changes: 20 additions & 0 deletions cmd/image/qcow2ova/validate/diskspace/diskspace_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package diskspace

import (
"fmt"
)

type Rule struct {
}

func (p *Rule) String() string {
return "diskspace"
}

func (p *Rule) Verify() error {
return fmt.Errorf("Not supported on Windows platform")
}

func (p *Rule) Hint() string {
return "Please retry on linux/ppc64le platform"
}

0 comments on commit 161853b

Please sign in to comment.