forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial comment to check workflow run from PRs. The workflow file needs to be in repo, before the integration tests workflow can kick off
- Loading branch information
Showing
4 changed files
with
518 additions
and
327 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
name: Build Binaries | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
- v8 | ||
- v7 | ||
paths-ignore: | ||
- 'doc/**' | ||
- '.gitpod.yml' | ||
- 'README.md' | ||
push: | ||
# branches: | ||
# - main | ||
# - v8 | ||
# - v7 | ||
# paths-ignore: | ||
# - 'doc/**' | ||
# - '.github/**' | ||
# - '.gitpod.yml' | ||
# - 'README.md' | ||
|
||
# permissions: | ||
# contents: read | ||
|
||
jobs: | ||
shared-values: | ||
name: Shared Values | ||
runs-on: ubuntu-latest | ||
outputs: | ||
go-version: ${{ steps.set-go-version.outputs.go-version }} | ||
cf-build-sha: ${{ steps.set-build-sha.outputs.cf-build-sha }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- id: set-go-version | ||
name: Parse Golang Version | ||
run: | | ||
go_version=($(grep -E '^go 1\.[[:digit:]]{1,2}' go.mod)) | ||
echo "golang version: ${go_version[1]}" | ||
echo "go-version=${go_version[1]}" >> $GITHUB_OUTPUT | ||
- id: set-build-sha | ||
name: Get Build SHA | ||
run: | | ||
build_sha=$(git rev-parse --short HEAD) | ||
echo "cf-build-sha=${build_sha}" >> $GITHUB_OUTPUT | ||
# echo $build-sha > ./sha | ||
|
||
# - name: 'Export SHA' | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: sha | ||
# path: ./sha | ||
|
||
build-linux-binaries: | ||
name: Build Linux binaries | ||
runs-on: ubuntu-latest | ||
needs: | ||
- shared-values | ||
outputs: | ||
linux-binaries: ${{ steps.build-linux-binaries.outputs.linux-binaries }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ needs.shared-values.outputs.go-version }} | ||
|
||
- name: Build Linux | ||
id: build-linux | ||
run: | | ||
set -ex | ||
export GOPATH=$PWD/gopath | ||
export PATH=$GOPATH/bin:$PATH | ||
go version | ||
export CF_BUILD_SHA=${{ needs.shared-values.outputs.cf-build-sha }} | ||
# echo "Building 32-bit Linux" | ||
# make out/cf-cli_linux_i686 | ||
echo "Building 64-bit Linux" | ||
make out/cf-cli_linux_x86-64 | ||
echo "Creating tarball" | ||
tar -cvzf ${PWD}/cf-cli-linux-binaries-${CF_BUILD_SHA}.tgz -C out . | ||
linux_binaries="cf-cli-linux-binaries-${CF_BUILD_SHA}.tgz" | ||
echo "linux-binaries=${linux_binaries}" >> $GITHUB_OUTPUT | ||
- name: 'Upload Linux Binaries' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.build-linux.outputs.linux-binaries }} | ||
path: ./cf-cli-linux-binaries-* | ||
|
||
# build-windows-binaries: | ||
# name: Build Windows binaries | ||
# runs-on: windows-latest | ||
# needs: | ||
# - shared-values | ||
# outputs: | ||
# windows-binaries: ${{ steps.build-windows-binaries.outputs.windows-binaries }} | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Set up Go | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: ${{ needs.shared-values.outputs.go-version }} | ||
|
||
# - name: Get build-time dependencies | ||
# run: | | ||
# choco install --no-progress --limit-output -y make | ||
# go install github.com/akavel/rsrc@v0.10.2 | ||
|
||
# - name: Build Windows | ||
# id: build-windows | ||
# run: | | ||
# Get-Command make | ||
# Get-Item Makefile | ||
|
||
# $CF_BUILD_SHA="${{ needs.shared-values.outputs.cf-build-sha }}" | ||
|
||
# # echo "Building 32-bit Windows" | ||
# # make out/cf-cli_win32.exe | ||
|
||
# echo "Building 64-bit Windows" | ||
# make out/cf-cli_winx64.exe | ||
|
||
# echo "Creating tarball" | ||
# tar -cvzf cf-cli-windows-binaries-${CF_BUILD_SHA}.tgz -C out . | ||
# $windows_binaries="cf-cli-windows-binaries-${CF_BUILD_SHA}.tgz" | ||
# echo "windows-binaries ================ ${windows_binaries}" | ||
# echo "windows-binaries=${windows_binaries}" >> $GITHUB_OUTPUT | ||
|
||
# - name: 'Upload Windows Binaries' | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: ${{ steps.build-windows.outputs.windows-binaries }} | ||
# path: cf-cli-windows-binaries-* | ||
|
||
# - name: Setup tmate session | ||
# if: always() | ||
# uses: mxschmitt/action-tmate@v3 |
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
Oops, something went wrong.