-
Notifications
You must be signed in to change notification settings - Fork 29
132 lines (129 loc) · 6 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
- name: Check out enterprise
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
- name: Check out enterprise
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
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"