From 95e7a2f2dbe7635367bcd0cbbae46a6347b45f40 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sun, 24 Apr 2022 02:36:35 -0600 Subject: resolves #2065 set up fully automated release (PR #2069) [no ci] --- .github/workflows/release.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb1cfc61..c6f5bd84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,20 @@ name: Release on: - push: - tags: ['v*'] + workflow_dispatch: + inputs: + release-version: + description: Enter version to release (e.g., 2.0.1). + required: false jobs: activate: - if: github.repository_owner == 'asciidoctor' runs-on: ubuntu-latest + if: github.repository_owner == 'asciidoctor' && github.event_name == 'workflow_dispatch' steps: - - name: Proceed - run: echo ok go - build: + - run: echo ok go + perform: needs: activate runs-on: ubuntu-latest + environment: releases env: ASCIIDOCTOR_DIAGRAM_VERSION: '~> 2.2' PRAWN_GMAGICK_VERSION: '0.0.9' @@ -24,19 +27,24 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: '3.1' + bundler-cache: false - name: Install Linux packages run: | sudo apt-get update sudo apt-get install ghostscript poppler-utils libgraphicsmagick1-dev - name: Configure Bundler run: | - bundle config --local path .bundle/gems - bundle config --local without coverage docs lint + bundle config --local path vendor/bundle + bundle config --local without coverage docs - name: Install dependencies run: bundle --jobs 3 --retry 3 - name: Run tests run: bundle exec rake spec - - name: Publish gem - uses: dawidd6/action-publish-gem@v1 - with: - api_key: ${{ secrets.RUBYGEMS_API_KEY }} + - name: Run linter + run: bundle exec rake lint + - name: Setup release environment + run: | + echo RELEASE_VERSION=${{ github.event.inputs.release-version }} >> $GITHUB_ENV + echo RELEASE_RUBYGEMS_API_KEY=${{ secrets[format('RUBYGEMS_API_KEY_{0}', github.actor)] }} >> $GITHUB_ENV + - name: Build, tag, and publish gem + run: ./release.sh -- cgit v1.2.3