-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure github-action to generate bosh releases
- Loading branch information
Showing
9 changed files
with
64 additions
and
25 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,51 @@ | ||
name: build-and-release | ||
|
||
on: | ||
push: | ||
# not not consider simplec commit | ||
branches: | ||
- '!*' | ||
# consider only release and pre-release tags | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: create bosh release | ||
id: create-bosh-release | ||
uses: orange-cloudfoundry/bosh-release-action@v1 | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
AWS_BOSH_ACCES_KEY_ID: ${{ secrets.AWS_BOSH_ACCES_KEY_ID }} | ||
AWS_BOSH_SECRET_ACCES_KEY: ${{ secrets.AWS_BOSH_SECRET_ACCES_KEY }} | ||
|
||
- name: create github release | ||
id: create-github-release | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: "cutting release ${{ steps.create-bosh-release.outputs.version }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: upload-assets | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create-github-release.outputs.upload_url }} | ||
asset_path: ./${{ steps.create-bosh-release.outputs.file }} | ||
asset_name: ${{ steps.create-bosh-release.outputs.file }} | ||
asset_content_type: application/zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -17,3 +17,4 @@ tmp | |
*~ | ||
*# | ||
#* | ||
*.tar.gz |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
{} | ||
boshupdate_exporter_linux.tar.gz: | ||
size: 9088833 | ||
object_id: 2ba79aaa-66d1-4614-6474-aca1721c27ad | ||
sha: sha256:61097a36e603a0dafcf64a34db8cb3404b8a8a1a6c952bb532940a27967b2c64 |
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 |
---|---|---|
@@ -1,19 +1,10 @@ | ||
#!/bin/bash -eu | ||
#!/bin/bash -e | ||
|
||
ostype=$(uname | tr '[:upper:]' '[:lower:]') | ||
if [ -z "${BOSH_PACKAGES_DIR-}" ]; then | ||
pkg_dir=$(readlink -nf /var/vcap/packages/golang-1-${ostype}) | ||
else | ||
pkg_dir=${BOSH_PACKAGES_DIR}/golang-1-${ostype} | ||
fi | ||
bin_name="boshupdate_exporter" | ||
tar_name="${bin_name}_${ostype}.tar.gz" | ||
|
||
PACKAGE_NAME="github.com/orange-cloudfoundry/boshupdate_exporter" | ||
|
||
source ${pkg_dir}/bosh/compile.env | ||
|
||
mkdir -p ${GOPATH}/src/${PACKAGE_NAME} | ||
mkdir -p ${BOSH_INSTALL_TARGET}/bin | ||
cp -r boshupdate_exporter/* ${GOPATH}/src/${PACKAGE_NAME} | ||
|
||
cd ${GOPATH}/src/${PACKAGE_NAME}/exporter | ||
go build -a -ldflags "-s -w" -gcflags="all=-trimpath=$GOPATH" -o ${BOSH_INSTALL_TARGET}/bin/boshupdate_exporter | ||
tar zxf ${tar_name} --strip 1 -C ${BOSH_INSTALL_TARGET} | ||
mv ${BOSH_INSTALL_TARGET}/${bin_name} ${BOSH_INSTALL_TARGET}/bin | ||
mv ${BOSH_INSTALL_TARGET}/boshupdate_cli ${BOSH_INSTALL_TARGET}/bin |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
--- | ||
name: boshupdate_exporter | ||
|
||
dependencies: | ||
- golang-1-linux | ||
dependencies: [] | ||
|
||
files: | ||
- boshupdate_exporter/** | ||
- boshupdate_exporter_linux.tar.gz | ||
|
||
... |
This file was deleted.
Oops, something went wrong.
Submodule boshupdate_exporter
deleted from
3ff5ec