-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (39 loc) 路 1.3 KB
/
Copy pathc-cpp.yml
File metadata and controls
51 lines (39 loc) 路 1.3 KB
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
name: Build and Commit ash
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # needed to push changes
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Git credentials
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake make g++ libreadline-dev
- name: Configure project
run: cmake -B build
- name: Build project
run: cmake --build build -j$(nproc)
- name: Remove old ash binary
run: rm -f ./ash
- name: Copy new ash binary
run: cp build/ash ./ash
- name: Make binary executable
run: chmod +x ./ash
- name: Commit and push new binary
run: |
git add ash
git diff --cached --quiet && echo "No changes to commit 馃し" || git commit -m "Auto-build: updated ash binary"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:main