Skip to content

Commit

Permalink
[SRVKS-1071] Add github action to sync upstream (#75)
Browse files Browse the repository at this point in the history
* Add github action to sync upstream release

* Update README
  • Loading branch information
nak3 authored Jun 8, 2023
1 parent 2994996 commit eb5d5ca
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Sync upstream

on:
workflow_dispatch: # Manual workflow trigger
inputs:
release:
type: string
required: true
description: Release Version

jobs:
sync-upstream:
if: github.event.created || github.event_name == 'workflow_dispatch'
name:
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
UPSTREAM: https://github.com/knative-sandbox/net-kourier.git
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ./src/github.com/${{ github.repository }}
fetch-depth: 0
ref: ${{ inputs.release }}

- name: Sync upstream
working-directory: ./src/github.com/${{ github.repository }}
run: |
if ! git config user.name > /dev/null; then
git config user.name "John Doe"
fi
if ! git config user.email > /dev/null; then
git config user.email "johndoe@localhost"
fi
git remote add upstream "${UPSTREAM}"
git fetch upstream
BRANCH=${{ inputs.release }}
git merge upstream/"release-${BRANCH#release-v}"
shell: bash

- name: Regenerate all generated files
working-directory: ./src/github.com/${{ github.repository }}
run: ./openshift/release/generate-release.sh ${{ inputs.release }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: ./src/github.com/${{ github.repository }}
branch: auto/sync-upstream-${{ inputs.release }}
title: "[${{ inputs.release }}] Sync upstream release"
commit-message: "Sync upstream release"
delete-branch: true
body: |
Sync upstream release
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ fixes needed only for the OpenShift side of things.
# OpenShift net-kourier Release procedure

Currently the release cut is not automated but just one command.
Once upstream cuts the branch (e.g. upstream cut `release-1.9` branch), run:
Once upstream cuts the branch (e.g. upstream cut `release-v1.9` branch), run:

```sh
$ openshift/release/create-release-branch.sh release-1.9
$ openshift/release/create-release-branch.sh release-v1.9
```

Then, push the branch against to this repository.

## Sync upstream

The procedure is the same as [serving](https://github.com/openshift-knative/serving/blob/main/README.md).

0 comments on commit eb5d5ca

Please sign in to comment.