diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..4c9ab97 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,14 @@ +name: CD + +on: + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] + +jobs: + call-workflow-from-shared-config: + permissions: + contents: write + uses: rubyatscale/shared-config/.github/workflows/cd.yml@main + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 26e61d3..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Tag and Release Gem - -env: - GEM_NAME: query_packwerk - GEM_CLASS_NAME: QueryPackwerk - -on: - pull_request: - types: [closed] - branches: [main] - -permissions: - contents: write - actions: read - -jobs: - tag: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7.0.1 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3 - - - name: Determine release type - id: version - run: | - if [[ "${{ github.event.pull_request.labels[*] }}" == *"major"* ]]; then - echo "bump=major" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.pull_request.labels[*] }}" == *"minor"* ]]; then - echo "bump=minor" >> $GITHUB_OUTPUT - else - echo "bump=patch" >> $GITHUB_OUTPUT - fi - - - name: Bump version - run: | - gem install bump - bump ${{ steps.version.outputs.bump }} - - - name: Commit and tag version bump - run: | - # Attribute commits to the last committer on HEAD - git config --global user.email "$(git log -1 --pretty=format:'%ae')" - git config --global user.name "$(git log -1 --pretty=format:'%an')" - git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY" - VERSION=$(ruby -e "require './lib/${{ env.GEM_NAME }}/version'; puts ${{ env.GEM_CLASS_NAME }}::VERSION") - git commit -am "Bump version to $VERSION" - git tag "v$VERSION" - git push origin main "v$VERSION" - release: - if: github.repository == 'rubyatscale/query_packwerk' - runs-on: ubuntu-latest - environment: release - permissions: - contents: write - id-token: write - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up Ruby - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0 - with: - bundler-cache: true - ruby-version: ruby - - # Release - - uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1 diff --git a/Gemfile.lock b/Gemfile.lock index 50b88aa..1fb2a5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - query_packwerk (0.1.23) + query_packwerk (0.1.24) coderay packwerk parse_packwerk diff --git a/lib/query_packwerk/version.rb b/lib/query_packwerk/version.rb index 83f37ef..1e64a57 100644 --- a/lib/query_packwerk/version.rb +++ b/lib/query_packwerk/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module QueryPackwerk - VERSION = '0.1.23' + VERSION = '0.1.24' end