Skip to content

Commit

Permalink
Merge pull request #6 from go-vela/release
Browse files Browse the repository at this point in the history
Fix release pipeline
  • Loading branch information
Neal authored Nov 6, 2019
2 parents c883958 + 35ee674 commit cee66b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
name: release
on:
release:
types: [created]
types: [ created ]

jobs:
release:
name: release
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v1

- name: Generate
- name: build
uses: skx/github-action-build@master
with:
builder: ./build.sh

- name: Upload the artifacts
if: github.event_name == 'release'
builder: ./build.sh

- name: upload
uses: skx/github-action-publish-binaries@master
with:
args: 'release/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'release/vela*'
23 changes: 18 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@
set -e
set -x

# capture tag version from reference
tag=$(echo ${GITHUB_REF} | cut -d / -f 3)

# compile for all architectures
GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${VELA_TAG}" -o release/linux/amd64/vela github.com/go-vela/cli
GOOS=linux CGO_ENABLED=0 GOARCH=arm64 go build -ldflags "-X main.version=${VELA_TAG}" -o release/linux/arm64/vela github.com/go-vela/cli
GOOS=linux CGO_ENABLED=0 GOARCH=arm go build -ldflags "-X main.version=${VELA_TAG}" -o release/linux/arm/vela github.com/go-vela/cli
GOOS=windows CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${VELA_TAG}" -o release/windows/amd64/vela github.com/go-vela/cli
GOOS=darwin CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${VELA_TAG}" -o release/darwin/amd64/vela github.com/go-vela/cli
GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${tag}" -o release/linux/amd64/vela github.com/go-vela/cli
GOOS=linux CGO_ENABLED=0 GOARCH=arm64 go build -ldflags "-X main.version=${tag}" -o release/linux/arm64/vela github.com/go-vela/cli
GOOS=linux CGO_ENABLED=0 GOARCH=arm go build -ldflags "-X main.version=${tag}" -o release/linux/arm/vela github.com/go-vela/cli
GOOS=windows CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${tag}" -o release/windows/amd64/vela github.com/go-vela/cli
GOOS=darwin CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=${tag}" -o release/darwin/amd64/vela github.com/go-vela/cli

# tar binary files prior to upload
tar -cvzf release/vela_linux_amd64.tar.gz -C release/linux/amd64 vela
tar -cvzf release/vela_linux_arm64.tar.gz -C release/linux/arm64 vela
tar -cvzf release/vela_linux_arm.tar.gz -C release/linux/arm vela
tar -cvzf release/vela_windows_amd64.tar.gz -C release/windows/amd64 vela
tar -cvzf release/vela_darwin_amd64.tar.gz -C release/darwin/amd64 vela

# generate shas for tar files
sha256sum release/*.tar.gz > release/vela_checksums.txt
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var (
// VersionMajor is for an API incompatible changes
VersionMajor int64
// VersionMinor is for functionality in a backwards-compatible manner
VersionMinor int64 = 5
VersionMinor int64 = 1
// VersionPatch is for backwards-compatible bug fixes
VersionPatch int64
)
Expand Down

0 comments on commit cee66b7

Please sign in to comment.