Skip to content

create-pr

create-pr #239

Workflow file for this run

name: create pr
on:
repository_dispatch:
types: [create-pr]
jobs:
enterprise-pr-release:
name: update oss latest release
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Check out enterprise
uses: actions/checkout@v3
with:
repository: "weaveworks/weave-gitops-enterprise"
token: ${{ secrets.GITHUB_TOKEN }}
ref: main
fetch-depth: 0
- name: Fetch latest tag from weave-gitops
id: fetch-latest-tag
run: |
latest_tag=$(git ls-remote --tags https://github.com/weaveworks/weave-gitops.git | awk -F/ '$NF ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ {print $NF}' | sort -V | tail -n1)
echo "::set-output name=tag::$latest_tag"
- name: Configure git for private modules
env:
GITHUB_BUILD_USERNAME: wge-build-bot
GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com"
- name: Upgrade main version
run: |
set -x
latest_tag=${{ steps.fetch-latest-tag.outputs.tag }}
export GOPRIVATE=github.com/weaveworks
go get -u github.com/weaveworks/weave-gitops@$latest_tag
go mod tidy
yarn add @weaveworks/weave-gitops@$latest_tag
# This is a convience to help auto-update snapshots if core components have changed.
# However it can still fail if larger changes have been made, breaking the PR creation.
# In this case we still want to continue w/ PR creation and fixes can be made in the EE PR manually.
# So we do a `|| true` to continue this workflow even on failure.
yarn test -u || true
env:
GITHUB_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN}}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
with:
author: wge-build-bot <wge-build-bot@weave.works>
signoff: true
committer: wge-build-bot <wge-build-bot@weave.works>
branch: track-released-oss
base: main
title: "Bump weave-gitops to latest ${{ steps.fetch-latest-tag.outputs.tag }}"
body: |
Update weave-gitops to latest release ${{ steps.fetch-latest-tag.outputs.tag }}
# Uncomment this when you want to involve the author:
#
# cc @${{ github.event.sender.login }}
commit-message: "Bump version of weave-gitops to latest"
token: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }}
delete-branch: true
labels: "exclude from release notes"
enterprise-pr-main:
name: update oss main
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Check out enterprise
uses: actions/checkout@v3
with:
repository: "weaveworks/weave-gitops-enterprise"
token: ${{ secrets.GITHUB_TOKEN }}
ref: main
fetch-depth: 0
- name: Fetch unmerged changes
run: |
git config user.name wks-ci-test-bot
git config user.email wks-ci-test-bot@weave.works
git fetch origin
if git rev-parse -q --verify origin/track-latest-oss; then
git checkout origin/track-latest-oss
git merge origin/main
fi
- name: Configure git for private modules
env:
GITHUB_BUILD_USERNAME: wge-build-bot
GITHUB_BUILD_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://${GITHUB_BUILD_USERNAME}:${GITHUB_BUILD_TOKEN}@github.com".insteadOf "https://github.com"
- name: Upgrade main version
run: |
set -x
export GOPRIVATE=github.com/weaveworks
remote_main=$(git ls-remote https://github.com/weaveworks/weave-gitops.git refs/heads/main | awk '{print $1}')
echo $remote_main
go get -u github.com/weaveworks/weave-gitops@$remote_main
go mod tidy
npm_version=$(yarn info @weaveworks/weave-gitops-main time --json | jq -r '.data | keys | .[] | select(contains("$(remote_main)"))')
yarn add @weaveworks/weave-gitops@npm:@weaveworks/weave-gitops-main@$npm_version
# This is a convience to help auto-update snapshots if core components have changed.
# However it can still fail if larger changes have been made, breaking the PR creation.
# In this case we still want to continue w/ PR creation and fixes can be made in the EE PR manually.
# So we do a `|| true` to continue this workflow even on failure.
yarn test -u || true
env:
GITHUB_TOKEN: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN}}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
with:
author: wge-build-bot <wge-build-bot@weave.works>
signoff: true
committer: wge-build-bot <wge-build-bot@weave.works>
branch: track-latest-oss
base: main
title: "Bump weave-gitops to latest"
body: |
Update weave-gitops to unstable commit ${{ needs.ci-publish-js-lib.outputs.js-version }}
# Uncomment this when you want to involve the author:
#
# cc @${{ github.event.sender.login }}
commit-message: "Bump version of weave-gitops to latest"
token: ${{ secrets.BUILD_BOT_PERSONAL_ACCESS_TOKEN }}
delete-branch: true
labels: "exclude from release notes"