-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 2.43 KB
/
build-release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build & Release ISO
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: byondvm
- name: Cache Buildroot CCache
id: cache-ccache
uses: actions/cache@v4
with:
path: ~/.buildroot-ccache
key: linux-buildroot-ccache
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Download Buildroot
run: |
wget https://buildroot.org/downloads/buildroot-2024.02.3.tar.gz
tar -xzf ./buildroot-2024.02.3.tar.gz
mv -v ./buildroot-2024.02.3/ ./buildroot
mv -v ./byondvm ./buildroot/byondvm
- name: Setup Buildroot
run: |
sudo apt-get update
sudo apt-get install -y sed make binutils build-essential diffutils gcc gcc-multilib g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget
- name: Compile
run: |
cd ./buildroot
export BR2_EXTERNAL=byondvm
make defconfig byondvm_defconfig
make -j ${{ steps.cpu-cores.outputs.count }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
path: buildroot/output/images/*
- name: Set current date as env variable
if: github.event_name == 'push'
run: |
cd ./buildroot/byondvm # Go to the actual repo
echo "HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Push tag
if: github.event_name == 'push'
run: |
cd ./buildroot/byondvm # Go to the actual repo
git tag ${{ env.HASH }}
git push origin --tags
- name: Create Release
uses: ncipollo/release-action@v1
if: github.event_name == 'push'
with:
artifacts: "buildroot/output/images/*"
tag: ${{ env.HASH }}
generateReleaseNotes: true
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: buildroot/output/images
deploy:
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4