Skip to content

Commit

Permalink
GitHub Actions automatic build & release workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeWaka committed Jun 23, 2023
1 parent d50c4aa commit 2201f2b
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build & Release ISO

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
path: byondvm

- name: Cache Buildroot CCache
id: cache-ccache
uses: actions/cache@v3
with:
path: ~/.buildroot-ccache
key: linux-buildroot-ccache

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Download Buildroot
run: |
wget https://buildroot.org/downloads/buildroot-2022.05.tar.gz
tar -xzf ./buildroot-2022.05.tar.gz
mv -v ./buildroot-2022.05/ ./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 }}
make -j ${{ steps.cpu-cores.outputs.count }}
mv ./output/images/rootfs.iso9660 ./controller.iso
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: controller.iso
path: buildroot/controller.iso

- 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/controller.iso"
tag: ${{ env.HASH }}
generateReleaseNotes: true

0 comments on commit 2201f2b

Please sign in to comment.