update-cli #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-cli | |
on: | |
repository_dispatch: | |
types: [update-cli] | |
workflow_dispatch: | |
inputs: | |
cli_version: | |
description: 'Version of the CLI to update to' | |
required: true | |
type: string | |
jobs: | |
update-cli: | |
runs-on: ubuntu-latest | |
env: | |
RAW_VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.cli_version || inputs.cli_version }} | |
BUNDLE_GITHUB__COM: ${{ secrets.BUNDLE_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
ref: next | |
- name: Configure Git | |
run: | | |
git config --global user.name "Bumpsnag Bot" | |
git config --global user.email "" | |
- name: Install ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
- name: Install libcurl4-openssl-dev and net-tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev net-tools | |
- name: Install dependencies | |
run: bundle install | |
- name: Remove leading 'v' | |
shell: bash | |
run: | | |
echo "CLI_VERSION=${RAW_VERSION#v}" >> $GITHUB_ENV | |
- name: Update the CLI reference | |
run: | | |
echo "Bumping CLI to version $CLI_VERSION" | |
sed -i -E "s/private const string DOWNLOADED_CLI_VERSION = \".*\";/private const string DOWNLOADED_CLI_VERSION = \"$CLI_VERSION\";/g" Bugsnag/Assets/Bugsnag/Editor/SymbolUpload/BugsnagCLI.cs | |
- name: Create bump commit | |
run: | | |
bundle exec bumpsnag commit_update bugsnag-cli $RAW_VERSION | |
- name: Create pull request | |
if: ${{ steps.current-branch.outputs.branch != 'next'}} | |
run: > | |
gh pr create -B next | |
-H bumpsnag-bugsnag-cli-$RAW_VERSION | |
--title "Update bugsnag-cli to version $RAW_VERSION" | |
--body 'Created by bumpsnag' | |
--reviewer richardelms | |