Skip to content

Commit

Permalink
Update from base builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Neilpang committed Nov 9, 2024
1 parent 37273af commit 65f06e6
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/tpl/README.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


[![Build](https://github.com/vmactions/{{VM_OS_NAME}}-builder/actions/workflows/build.yml/badge.svg)](https://github.com/vmactions/{{VM_OS_NAME}}-builder/actions/workflows/build.yml)

Latest: {{LATEST_TAG}}


The image builder for [{{VM_OS_NAME}}-vm](https://github.com/vmactions/{{VM_OS_NAME}}-vm)


How to use:

1. Use the [manual.yml](.github/workflows/manual.yml) to build manually.

Run the workflow manually, you will get a view-only webconsole from the output of the workflow, just open the link in your web browser.

You will also get an interactive VNC connection port from the output, you can connect to the vm by any vnc client.

2. Run the builder locally on your Ubuntu machine.

Just clone the repo. and run:
```bash
bash build.sh {{LATEST_CONF}}
```

68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "Build"
on:
push:
branches:
- '*'
paths:
- '*.sh'
- '.github/workflows/build.yml'
- '*.txt'
- 'conf/*'
- 'hooks/*'
pull_request:
branches:
- '*'
paths:
- '*.sh'
- '.github/workflows/build.yml'
- '*.txt'
- 'conf/*'
- 'hooks/*'
workflow_dispatch:

release:
types: [ created ]


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
build:
strategy:
matrix:
os: ["202404"]
runs-on: ubuntu-24.04
env:
SEC_VBOX : ${{ secrets.SEC_VBOX }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
- uses: actions/checkout@v4
- name: Creating Web console
uses: vmactions/cf-tunnel@v0
id: tunnel
with:
protocol: http
port: 8000
- run: |
bash build.sh conf/openindiana-${{ matrix.os }}.conf
- name: Upload Release Asset
if: "contains(github.ref, 'refs/tags/')"
id: upload-release-asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
openindiana-${{ matrix.os }}.qcow2.zst*
openindiana-${{ matrix.os }}-id_rsa.pub
openindiana-${{ matrix.os }}-host.id_rsa
44 changes: 44 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Manual"
on:
workflow_dispatch:


jobs:
build:
runs-on: ubuntu-24.04
env:
DEBUG: 1
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
SEC_VBOX : ${{ secrets.SEC_VBOX }}
steps:
- uses: actions/checkout@v4
- name: Creating web console
uses: vmactions/cf-tunnel@v0
id: tunnel
with:
protocol: http
port: 8000
- name: Run vnc tunnel
id: test
uses: vmactions/ngrok-tunnel@v0
with:
protocol: tcp
port: 5900
- name: Sleep
run: |
for i in $(seq 1 10) ; do echo $i; sleep 1; done
latest=$(cat $(ls conf/openindiana-*.conf | tail -1) | grep VM_RELEASE | cut -d = -f 2)
echo "please loging to ssh below, and run:"
echo "============================="
echo "bash build.sh conf/openindiana-$latest.conf"
echo "============================="
touch /tmp/keepalive
- uses: neilpang/debugger-action@master







50 changes: 50 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Update Readme"
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '.github/tpl/*'
- '.github/data/*'
- '.github/workflows/readme.yml'

release:
types: [ published ]


jobs:
readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get latest release
id: get-latest-release
uses: InsonusK/[email protected]
with:
myToken: ${{ github.token }}
view_top: 1

- name: Using main branch
run: |
git switch main || (git fetch --all && git checkout -b main origin/main)
echo "LATEST_MAJOR=$(echo ${{ steps.get-latest-release.outputs.tag_name }} | cut -d . -f 1)" >> $GITHUB_ENV
echo "LATEST_TAG=${{ steps.get-latest-release.outputs.tag_name }}" >> $GITHUB_ENV
latest=$(ls conf/*.conf | tail -1)
echo "LATEST_CONF=$latest" >> $GITHUB_ENV
- name: Update the readme.md
uses: vmactions/[email protected]
with:
datafile: .github/data/datafile.ini
files: |
.github/tpl/README.tpl.md : README.md
- uses: EndBug/add-and-commit@v9
with:
message: "Update version to ${{ steps.get-latest-release.outputs.tag_name }}"
pull: '--rebase --autostash '
add: |
README.md
Loading

0 comments on commit 65f06e6

Please sign in to comment.