Skip to content

Auto update build plan #47

Auto update build plan

Auto update build plan #47

name: Auto update build plan
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
schedule:
# Every friday at 4 PM
- cron: "0 16 1 * *"
push:
paths:
- coordinator/**
jobs:
build-plan:
runs-on: ubuntu-22.04
if: github.repository == 'VirtusLab/community-build3'
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Install coursier
uses: coursier/setup-action@v1
with:
apps: scala-cli
- 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
# Build only projects present in filtered out list
run: |
filtered=$(grep -vE '^\s*#|^\s*$' coordinator/configs/filtered-projects.txt | awk -F: '$2 !~ /\*/ { print $1 "/" $2 }' | tr '\n' ',')
echo "" > coordinator/configs/filtered-projects.txt
scala-cli run coordinator/ -- 3 -1 0 "${filtered}" 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