This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (45 loc) · 1.52 KB
/
scaffold.yml
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
name: Build scaffold
on:
workflow_dispatch:
inputs:
projects:
description: 'Projects to generate, separated by spaces'
required: true
default: 'kernel memoria cpu filesystem'
static:
description: 'Static lib to generate'
required: true
default: 'utils'
external:
description: 'External libs to include, separated by spaces'
required: true
default: 'commons pthread readline m'
branch:
description: 'Branch to push the generated files'
required: true
default: 'scaffold'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Generate scaffold files
run: |
bun ./scripts/scaffold.js \
--projects "${{ github.event.inputs.projects }}" \
--staticLib "${{ github.event.inputs.static }}" \
--externalLibs "${{ github.event.inputs.external }}"
- name: Push to scaffold branch
run: |
git switch --orphan ${{ github.event.inputs.branch }}
mv dist/{.gitignore,*} .
git add .
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Generate tp-scaffold files"
git push -f origin ${{ github.event.inputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}