Skip to content

Commit

Permalink
Merge pull request StratOS-Linux#13 from zstg/main
Browse files Browse the repository at this point in the history
Added GitHub action to automate ISO building (on push)
  • Loading branch information
slipstream8125 authored May 1, 2024
2 parents f883cc7 + 7ea8b69 commit f6fc3a8
Show file tree
Hide file tree
Showing 6 changed files with 2,232 additions and 7 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Release ISO

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:latest
options: --privileged

steps:
- name: Checkout repository using git
run: |
pacman -Sy git sudo archiso --noconfirm
git clone --recurse-submodules https://github.com/zstg/StratOS-iso
- name: Set up environment
run: |
export BUILD_DATE=$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
echo "::set-output name=date::${BUILD_DATE}"
- name: Build ISO
id: build_iso
run: |
cd StratOS-iso
sudo bash ./build.sh
- name: Create GitHub Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.BUILD_DATE }}
release_name: v${{ env.BUILD_DATE }}
body: |
Automated release powered by GitHub Actions.
- name: Upload ISO as Release Asset
id: upload_asset
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: StratOS-iso/output/StratOS-${{ env.BUILD_DATE }}-x86_64.iso
asset_name: StratOS-${{ env.BUILD_DATE }}-x86_64.iso
asset_content_type: application/octet-stream
39 changes: 39 additions & 0 deletions .github/workflows/deploy_yml_bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release ISO

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Archlinux
run: |
# sudo apt -y update
# sudo apt install sudo
curl -L https://raw.githubusercontent.com/zstg/github-actions-archlinux/master/install.sh | sudo bash

- name: Checkout repository using git
run: |
# pacman -Sy git sudo archiso --noconfirm
git clone --recurse-submodules https://github.com/zstg/StratOS-iso

- name: Build ISO
id: build_iso
run: |
cd StratOS-iso
export BUILD_DATE=$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y.%m.%d)
# sudo mount -t proc proc /__w/StratOS-iso/StratOS-iso/StratOS-iso/output/x86_64/airootfs/proc
# sudo chmod +x ./build.sh
su -c 'chmod +x ./build.sh && bash ./build.sh' # admin perms required to mount /proc
echo "::set-output name=date::${BUILD_DATE}"

- name: Upload
uses: ncipollo/release-action@v1
with:
artifacts: "output/*.iso"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.build.outputs.date }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
output/
output.bak/
output/*
!output/StratOS-*.iso
output.bak/
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "airootfs/usr/share/backgrounds/StratOS"]
path = airootfs/usr/share/backgrounds/StratOS
url = https://github.com/lugvitc/StratOS-wallpapers
[submodule "airootfs/opt/maneki-neko"]
path = airootfs/opt/maneki-neko
url = https://github.com/zstg/stratOS-maneki-neko
url = https://github.com/StratOS-Linux/StratOS-wallpapers
# [submodule "airootfs/opt/maneki-neko"]
# path = airootfs/opt/maneki-neko
# url = https://github.com/StratOS-Linux/stratOS-maneki-neko
[submodule "airootfs/etc/calamares"]
path = airootfs/etc/calamares
url = https://github.com/zstg/StratOS-calamares
url = https://github.com/StratOS-Linux/StratOS-calamares-settings
[submodule "airootfs/etc/skel/.config/nvim"]
path = airootfs/etc/skel/.config/nvim
url = https://github.com/StratOS-Linux/StratVIM.git
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ sudo mkarchiso -v \
-w output \
-o output \
./
echo output/*.iso | awk -F/ '{print $NF}'
Loading

0 comments on commit f6fc3a8

Please sign in to comment.