From d7e07dbb9e11741607773fea035c8cc9b99123ef Mon Sep 17 00:00:00 2001 From: Xavier MARCELET Date: Sat, 13 Feb 2021 18:37:27 +0100 Subject: [PATCH] use github actions to genereate bosh release --- .github/workflows/main.yml | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0711f08 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 }}