Skip to content

Commit

Permalink
Move CI pipeline to GHA (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchezgavier authored Nov 26, 2020
1 parent 53f0239 commit dbb09a3
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 35 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/PullRequestAndMergeMaster.yml
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
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

0 comments on commit dbb09a3

Please sign in to comment.