-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the need for manual release preparation commits: - Add a new `Prepare release` workflow that creates a pull request preparing the new release - Modify the `Release` job to run when: - A pull request modifying the `plugins.yaml` is merged, and - The pull request head reference matches `release/**`
- Loading branch information
Showing
2 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Prepare release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Release tag (i.e. v1.2.3)' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
Prepare: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Config Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Fetch Version | ||
run: echo PLUGIN_VERSION=$(echo "${{ inputs.tag }}" | tr -d 'v') >> "$GITHUB_ENV" | ||
|
||
- name: Update Version | ||
run: | | ||
sed -i "s/version: \".*\"/version: \"$PLUGIN_VERSION\"/" plugin.yaml | ||
sed -i "s/var Version = \".*\"/var Version = \"$PLUGIN_VERSION\"/" cmd/dt/version.go | ||
git checkout -B release/$PLUGIN_VERSION | ||
git add plugin.yaml cmd/dt/version.go | ||
git commit -m 'Prepare release ${{ inputs.tag }}' | ||
git push origin release/$PLUGIN_VERSION | ||
- name: Create PR | ||
run: gh pr create --fill --base main --repo $GITHUB_REPOSITORY | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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