Skip to content

Commit 3721e95

Browse files
authored
Merge pull request #557 from wraschke/gh-actions-292
Enable GitHub Actions workflow to automate new release updates
2 parents aadde42 + 99ff36e commit 3721e95

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This workflow is triggered by manual inputs.
2+
3+
name: Update files for the new release
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
OLD_VERSION:
9+
description: 'Enter old version'
10+
# Show defaults as examples so user enters correct format.
11+
default: '23.0.0.11'
12+
required: true
13+
type: string
14+
NEW_VERSION:
15+
description: 'Enter new version'
16+
default: '23.0.0.12'
17+
required: true
18+
type: string
19+
BUILD_LABEL:
20+
description: 'Enter build label of release driver'
21+
default: 'replace_with_gm_driver_label'
22+
required: false
23+
type: string
24+
25+
jobs:
26+
automate_release_updates:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Show useful information about the workflow environment
31+
run: echo "🔎 This workflow is running in branch ${{ github.ref }} and repository ${{ github.repository }}."
32+
33+
# This repository and branch to clone and checkout on runner
34+
# could be different than repo and branch where workflow runs.
35+
# Be aware of this nuance.
36+
- name: Check out repository code to runner
37+
uses: actions/checkout@v4
38+
with:
39+
ref: vNext
40+
repository: WASdev/ci.docker
41+
42+
- name: Run update script
43+
run: bash ./create-new-release.sh ${{ inputs.OLD_VERSION }} ${{ inputs.NEW_VERSION }} ${{ inputs.BUILD_LABEL }}
44+
45+
- name: Commit changes
46+
uses: EndBug/add-and-commit@v9
47+
with:
48+
default_author: github_actions
49+
author_name: GitHub Actions
50+
message: "Updates for the release of ${{ inputs.NEW_VERSION }}"
51+
add: '${{ github.workspace }}/ga/* ${{ github.workspace }}/.travis.yml'
52+
new_branch: "${{ inputs.NEW_VERSION }}-release"
53+
push: true
54+
tag_push: '--force'
55+
56+
- name: Create Pull Request
57+
run: |
58+
gh pr create -B vNext -H "${{ inputs.NEW_VERSION }}-release" -r mbroz2 -r leochr --title "Updates for the release of ${{ inputs.NEW_VERSION }}" --body "Created by Github Actions"
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- run: echo "🍏 This job's status is ${{ job.status }}."

0 commit comments

Comments
 (0)