From 06d4cdf17b8aaffd9d8007de46f57dcf3e380cea Mon Sep 17 00:00:00 2001 From: Ben Topping Date: Wed, 10 Feb 2021 14:35:21 +0000 Subject: [PATCH] added manual release creation workflow --- ...ld.yml => automated_release_and_build.yml} | 7 +++- .github/workflows/manual_build.yml | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) rename .github/workflows/{build.yml => automated_release_and_build.yml} (86%) create mode 100644 .github/workflows/manual_build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/automated_release_and_build.yml similarity index 86% rename from .github/workflows/build.yml rename to .github/workflows/automated_release_and_build.yml index 3b87a8e49..bcf171b03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/automated_release_and_build.yml @@ -1,4 +1,7 @@ -name: Build Project +# Automatically generate a release on develop and master +# Note: This does *not* trigger the `release: published` action so will not +# cause the build.yml action to fire. +name: Automated release and build of project on: push: @@ -49,5 +52,5 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} # Pull the upload url from previous events asset_path: ./release.tar.gz - asset_name: gh-release.tar.gz + asset_name: release.tar.gz asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/manual_build.yml b/.github/workflows/manual_build.yml new file mode 100644 index 000000000..4ba8cd686 --- /dev/null +++ b/.github/workflows/manual_build.yml @@ -0,0 +1,40 @@ +# Triggers on *manual* release creation only. Automated releases +# handle asset creation in automated_release_and_build.yml. + +name: Build Manual Release + +on: + release: + types: published + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml + # example if you need more control over bundler. + + - name: Set up environment + run: | + cp config/database.yml.example config/database.yml + cp config/mailer.yml.example config/mailer.yml + cp config/bunny.yml.example config/bunny.yml + cp config/env_constants.yml.example config/env_constants.yml + + - name: Compile Build + run: ./compile-build + + - name: Upload release.gz + id: upload-release-gz + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} # Pull the URL from the release step + asset_path: ./release.tar.gz + asset_name: release.tar.gz + asset_content_type: application/gzip \ No newline at end of file