-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53f0239
commit dbb09a3
Showing
2 changed files
with
82 additions
and
35 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,82 @@ | ||
name: PR/Release pipeline | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
BuildAndTest: | ||
name: Build And Test | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
GO111MODULE: off | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
|
||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
go get -u -v github.com/golang/dep/cmd/dep | ||
# Dependencies needed to generate the tile | ||
sudo apt update && sudo apt install -y build-essential zlibc zlib1g-dev ruby ruby-dev openssl libxslt1-dev libxml2-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 | ||
curl -O -L https://github.com/cloudfoundry/bosh-cli/releases/download/v6.2.0/bosh-cli-6.2.0-linux-amd64 | ||
chmod +x ./bosh-cli-6.2.0-linux-amd64 | ||
sudo mv ./bosh-cli-6.2.0-linux-amd64 /usr/local/bin/bosh | ||
curl -O -L https://github.com/cf-platform-eng/tile-generator/releases/download/v14.0.3/tile_linux-64bit | ||
chmod +x tile_linux-64bit | ||
sudo mv tile_linux-64bit /usr/local/bin/tile | ||
- name: Get version | ||
id: get_version | ||
if: github.event.action == 'published' | ||
run: | | ||
TAG=${{ github.event.release.tag_name }} | ||
# Remove 'v' from tag name | ||
RELEASE_TAG=${TAG//v} | ||
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV | ||
echo "::set-output name=VERSION::${RELEASE_TAG}" | ||
- name: Test and Build | ||
run: | | ||
make release | ||
- name: Upload Tile | ||
if: github.event.action == 'published' | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/product/nr-firehose-nozzle-${{ steps.get_version.outputs.VERSION }}.pivotal | ||
asset_name: nr-firehose-nozzle-${{ steps.get_version.outputs.VERSION }}.pivotal | ||
asset_content_type: Tile | ||
|
||
- name: Upload Tarball | ||
if: github.event.action == 'published' | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/dist/nr-fh-nozzle.tar.gz | ||
asset_name: nr-firehose-nozzle-${{ steps.get_version.outputs.VERSION }}.tar.gz | ||
asset_content_type: Tarball |
This file was deleted.
Oops, something went wrong.