diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index 53d77e86c5b6f..a58e87fd5541a 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -148,6 +148,35 @@ jobs: # ├── metasploit-framework # └── metasploit-payloads (Only if the "payload-testing-branch" GitHub label is applied) # └── mettle (Only if the "payload-testing-mettle-branch" GitHub label is applied) + - name: Get metasploit-payloads version + run: | + echo "METASPLOIT_PAYLOADS_VERSION=$(ruby -ne 'puts $& if /[0-9].[0-9].[0-9]*/' gem/lib/metasploit-payloads/version.rb)" | tee -a $GITHUB_ENV + working-directory: metasploit-payloads + + - name: Build metasploit-payloads gem + run: | + gem build ./gem/metasploit-payloads.gemspec + working-directory: metasploit-payloads + + - name: Copy metasploit-payloads gem into metasploit-framework - Windows + if: runner.os == 'Windows' + run: | + copy ..\metasploit-payloads\metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem . + working-directory: metasploit-framework + + - name: Copy metasploit-payloads gem into metasploit-framework + run: | + cp ../metasploit-payloads/metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem . + working-directory: metasploit-framework + + - name: Install metasploit-payloads gem + run: | + bundle exec gem install metasploit-payloads-${{ env.METASPLOIT_PAYLOADS_VERSION }}.gem + bundle config unset deployment + bundle update metasploit-payloads + bundle install + working-directory: metasploit-framework + - name: Checkout mettle if: ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }} uses: actions/checkout@v4 @@ -159,7 +188,7 @@ jobs: - name: Get mettle version if: ${{ matrix.meterpreter.name == 'mettle' && inputs.build_mettle }} run: | - echo "METTLE_VERSION=$(grep -oh '[0-9].[0-9].[0-9]*' lib/metasploit_payloads/mettle/version.rb)" | tee -a $GITHUB_ENV + echo "METTLE_VERSION=$(ruby -ne 'puts $& if /[0-9].[0-9].[0-9]*/' lib/metasploit_payloads/mettle/version.rb)" | tee -a $GITHUB_ENV working-directory: mettle - name: Prerequisite mettle gem setup