Skip to content

Commit

Permalink
Build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert Audenaert authored and FastGeert committed Nov 29, 2019
1 parent 929c56f commit 6906540
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 4 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ jobs:
version: # optional, default is 1.13
- name: Build
run: |
ls -ail
cd cmd/giginit
GOOS=windows GOARCH=amd64 go build
export GOOS=windows
mkdir -p /home/runner/go/src/github.com/gig-tech/windows-init
cp -r * /home/runner/go/src/github.com/gig-tech/windows-init
cd /home/runner/go/src/github.com/gig-tech/windows-init/app
go get
cd ../cmd/giginit
export GOARCH=amd64
go build
mv giginit.exe giginit-amd64.exe
export GOARCH=386
go build
mv giginit.exe giginit-386.exe
- uses: actions/upload-artifact@v1
with:
name: GIG Windows Initializer AMD64
path: /home/runner/go/src/github.com/gig-tech/windows-init/cmd/giginit/giginit-amd64.exe
- uses: actions/upload-artifact@v1
with:
name: GIG Windows Initializer 386
path: /home/runner/go/src/github.com/gig-tech/windows-init/cmd/giginit/giginit-amd64.exe
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: New release

on:
push:
tags:
- 'v*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Setup Go for use with actions
uses: actions/[email protected]
with:
# The Go version to download (if necessary) and use. Example: 1.9.3
version: # optional, default is 1.13
- name: Build
run: |
export GOOS=windows
mkdir -p /home/runner/go/src/github.com/gig-tech/windows-init
cp -r * /home/runner/go/src/github.com/gig-tech/windows-init
cd /home/runner/go/src/github.com/gig-tech/windows-init/app
go get
cd ../cmd/giginit
export GOARCH=amd64
go build
mv giginit.exe giginit-amd64.exe
export GOARCH=386
go build
mv giginit.exe giginit-386.exe
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/go/src/github.com/gig-tech/windows-init/cmd/giginit/giginit-amd64.exe
asset_name: GIG Windows Initializer for AMD64
asset_content_type: application/octect-stream
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/go/src/github.com/gig-tech/windows-init/cmd/giginit/giginit-386.exe
asset_name: GIG Windows Initializer for i386
asset_content_type: application/octect-stream
2 changes: 1 addition & 1 deletion cmd/giginit/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"git.gig.tech/openvcloud/windows-init/app"
"github.com/gig-tech/windows-init/app"
"github.com/pkg/errors"
)

Expand Down

0 comments on commit 6906540

Please sign in to comment.