-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (63 loc) · 2.1 KB
/
buildAutoUpdatePlan.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
name: Auto update build plan
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
schedule:
# Every friday at 4 PM
- cron: "0 16 * * 5"
push:
paths:
- coordinator/**
jobs:
build-plan:
runs-on: ubuntu-22.04
if: github.repository == 'VirtusLab/community-build3' && contains(github.ref, 'master')
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install coursier
uses: coursier/setup-action@v1
with:
apps: scala-cli:1.2.0
- name: Get Date
id: get-date
run: echo "week-start=$(date -dmonday +%Y%m%d)" >> $GITHUB_OUTPUT
# - name: Cache coordinator data
# uses: actions/cache@v3
# with:
# # coordinator stores cache in current working directory
# path: data/
# key: coordinator-data-cache-${{ steps.get-date.outputs.week-start}}
- name: Build plan
# Limit each build plan to at most 1000 most project.
# GitHub actions has problems when rendering workflow of more then 1k jobs
# Projects are grouped based on GitHub stars
run: scala-cli run coordinator/ -- 3 -1 -1 1000 "" coordinator/configs
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: "buildConfig"
path: |
.github/workflows/buildPlan*.yaml
.github/workflows/buildConfig.json
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: 303718
private_key: ${{ secrets.OPENCB_CONFIG_UPDATE_TOKEN }}
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: Update build config
assignees: WojciechMazur
branch: build/scheduled-update
branch-suffix: timestamp
delete-branch: true
title: "[Bot] Update build config"
draft: false
add-paths: |
.github/workflows/buildPlan*.yaml
.github/workflows/buildConfig.json