-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (62 loc) · 2.15 KB
/
autobump.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
name: Autobump
on:
workflow_dispatch:
schedule:
- cron: '0 20 * * *'
jobs:
bump:
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: "ci-robbot"
GIT_AUTHOR_EMAIL: robot@c3os.io
GIT_COMMITTER_NAME: "ci-robbot"
GIT_COMMITTER_EMAIL: robot@c3os.io
WORK_BRANCH: bumps
AUTO_GIT: true
GIT_SIGNOFF: true
LUET_NOLOCK: true
REVBUMP_CHAR: "-"
LUET_YES: true
TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_PRIVATE_KEY: "${{ secrets.BOT_PRIVATE_KEY }}"
GITHUB_PUBLIC_KEY: "${{ secrets.BOT_PUBLIC_KEY }}"
strategy:
matrix:
include:
- upstream_branch: "main"
fork: "git@github.com:ci-forks/packages.git"
upstream_repo: "https://github.com/kairos-io/packages"
name: "packages"
steps:
- env:
HUB_ARGS: "-b ${{ matrix.upstream_branch }}"
FORK_REPO: ${{ matrix.fork }}
UPSTREAM_REPO: ${{ matrix.upstream_repo }}
RESET_BRANCH: ${{ matrix.upstream_branch }}
name: Autobump ${{matrix.name}}
run: |
sudo rm -rf /usr/local/bin/yq
curl https://get.mocaccino.org/luet/get_luet_root.sh | sudo sh
sudo luet install -y repository/mocaccino-extra
sudo luet install -y system/luet-extensions system/luet-devkit utils/jq utils/yq vcs/hub utils/dasel
mkdir -p $HOME/.ssh
mkdir -p $HOME/.config
echo "$GITHUB_PRIVATE_KEY" > $HOME/.ssh/id_rsa
echo "$GITHUB_PUBLIC_KEY" > $HOME/.ssh/id_rsa.pub
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
git clone $FORK_REPO fork
cd fork
git remote add upstream $UPSTREAM_REPO
git fetch --all
git reset --hard upstream/${RESET_BRANCH}
git push -fv
echo "Removing working branch if present"
git branch -D $WORK_BRANCH || true
git checkout -b $WORK_BRANCH
git reset --hard upstream/${RESET_BRANCH}
git push -fv -u origin $WORK_BRANCH
export TREE_DIR=$PWD/packages
luet autobump-github