-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jai Luthra <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
18 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 |
---|---|---|
|
@@ -3,14 +3,6 @@ name: Generate Windows patches | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
os: | ||
description: 'Operating System' | ||
required: true | ||
default: 'win' | ||
type: choice | ||
options: | ||
- win | ||
- linux | ||
version: | ||
description: 'Driver Version' | ||
required: true | ||
|
@@ -37,23 +29,16 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Check OS and variant | ||
- name: Check variant | ||
id: check_input | ||
run: | | ||
os="${{ inputs.os }}" | ||
variant="${{ inputs.variant }}" | ||
version="${{ inputs.version }}" | ||
echo "Operating System: $os" | ||
echo "Variant: $variant" | ||
echo "Version: $version" | ||
if [[ $version =~ ([0-9]+\.[0-9]+(-[a-zA-Z]+)?)(-.+)? ]]; then | ||
if [ "$os" != "win" ]; then | ||
echo "Not a Windows release. Stopping the CI workflow." | ||
exit 0 | ||
fi | ||
echo "OS=$os" >> $GITHUB_ENV | ||
echo "VARIANT=$variant" >> $GITHUB_ENV | ||
echo "VERSION=$version" >> $GITHUB_ENV | ||
|
@@ -120,7 +105,8 @@ jobs: | |
cd "${{ github.workspace }}" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git checkout -b ${{ env.VERSION }} | ||
git add -A | ||
git diff --quiet --exit-code --cached || git commit -m "${{ env.OS }}: add support for ${{ env.VARIANT }} driver ${{ env.VERSION }}" -m "${{ inputs.description }}" | ||
git push origin master | ||
git diff --quiet --exit-code --cached || git commit -m "win: add support for ${{ env.VARIANT }} driver ${{ env.VERSION }}" -m "${{ inputs.description }}" | ||
git push origin ${{ env.VERSION }} | ||
echo "Committed and pushed changes" |