Skip to content

Commit a28fdaf

Browse files
author
neil
committed
init
1 parent 9b5602b commit a28fdaf

File tree

16 files changed

+1039
-0
lines changed

16 files changed

+1039
-0
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: vmactions
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/data/datafile.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
VM_OS_NAME=solaris
4+

.github/tpl/README.tpl.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
[![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)
4+
5+
Latest: {{LATEST_TAG}}
6+
7+
8+
The image builder for [{{VM_OS_NAME}}-vm](https://github.com/vmactions/{{VM_OS_NAME}}-vm)
9+
10+
11+
How to use:
12+
13+
1. Use the [manual.yml](.github/workflows/manual.yml) to build manually.
14+
15+
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.
16+
17+
You will also get an interactive VNC connection port from the output, you can connect to the vm by any vnc client.
18+
19+
2. Run the builder locally on your Ubuntu machine.
20+
21+
Just clone the repo. and run:
22+
```bash
23+
bash build.sh {{LATEST_CONF}}
24+
```
25+

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Build"
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
paths:
7+
- '*.sh'
8+
- '.github/workflows/build.yml'
9+
- '*.txt'
10+
- 'conf/*'
11+
- 'hooks/*'
12+
pull_request:
13+
branches:
14+
- '*'
15+
paths:
16+
- '*.sh'
17+
- '.github/workflows/build.yml'
18+
- '*.txt'
19+
- 'conf/*'
20+
- 'hooks/*'
21+
workflow_dispatch:
22+
23+
release:
24+
types: [ created ]
25+
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
32+
jobs:
33+
build:
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: ["11.4", "11.4-gcc"]
38+
runs-on: ubuntu-24.04
39+
env:
40+
SEC_VBOX : ${{ secrets.SEC_VBOX }}
41+
steps:
42+
# - name: Free Disk Space (Ubuntu)
43+
# uses: jlumbroso/free-disk-space@main
44+
# with:
45+
# # this might remove tools that are actually needed,
46+
# # if set to "true" but frees about 6 GB
47+
# tool-cache: false
48+
- uses: actions/checkout@v4
49+
- name: Creating Web console
50+
uses: vmactions/cf-tunnel@v0
51+
id: tunnel
52+
with:
53+
protocol: http
54+
port: 8000
55+
- run: |
56+
bash build.sh conf/solaris-${{ matrix.os }}.conf
57+
- name: Upload Release Asset
58+
if: "contains(github.ref, 'refs/tags/')"
59+
id: upload-release-asset
60+
uses: softprops/action-gh-release@v2
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
files: |
65+
solaris-${{ matrix.os }}.qcow2.zst*
66+
solaris-${{ matrix.os }}-id_rsa.pub
67+
solaris-${{ matrix.os }}-host.id_rsa
68+
69+

.github/workflows/generate.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Step 2, Generate the project from Base builder"
2+
on:
3+
schedule:
4+
- cron: '10 1 * * *'
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- 'main'
9+
paths:
10+
- 'conf/*'
11+
- '.github/data/*'
12+
- '.github/workflows/generate.yml'
13+
14+
15+
jobs:
16+
generate:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.VM_TOKEN }}
22+
fetch-depth: '2'
23+
24+
- name: Preparing env variables
25+
run: |
26+
git switch main || (git fetch --all && git checkout -b main origin/main)
27+
. conf/all.release.conf
28+
echo "ALL_RELEASES=$ALL_RELEASES" >> $GITHUB_ENV
29+
git clone https://github.com/vmactions/base-builder.git
30+
mkdir -p .github/tpl
31+
cat base-builder/.github/tpl/README.tpl.md >.github/tpl/README.tpl.md
32+
33+
- name: Generate files
34+
uses: vmactions/render@v0.0.1
35+
with:
36+
datafile: .github/data/datafile.ini
37+
files: |
38+
base-builder/.github/tpl/build.tpl.yml : .github/workflows/build.yml
39+
base-builder/.github/tpl/manual.tpl.yml : .github/workflows/manual.yml
40+
base-builder/.github/FUNDING.yml : .github/FUNDING.yml
41+
base-builder/.github/workflows/readme.yml : .github/workflows/readme.yml
42+
base-builder/build.sh : build.sh
43+
44+
- uses: EndBug/add-and-commit@v9
45+
with:
46+
message: "Update from base builder"
47+
pull: '--rebase --autostash '
48+
add: |
49+
.github/workflows/readme.yml
50+
.github/workflows/manual.yml
51+
.github/workflows/build.yml
52+
.github/tpl/README.tpl.md
53+
.github/FUNDING.yml
54+
build.sh
55+
56+

.github/workflows/manual.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Manual"
2+
on:
3+
workflow_dispatch:
4+
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-24.04
9+
env:
10+
DEBUG: 1
11+
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
12+
SEC_VBOX : ${{ secrets.SEC_VBOX }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Creating web console
16+
uses: vmactions/cf-tunnel@v0
17+
id: tunnel
18+
with:
19+
protocol: http
20+
port: 8000
21+
- name: Run vnc tunnel
22+
id: test
23+
uses: vmactions/ngrok-tunnel@v0
24+
with:
25+
protocol: tcp
26+
port: 5900
27+
- name: Sleep
28+
run: |
29+
for i in $(seq 1 10) ; do echo $i; sleep 1; done
30+
latest=$(cat $(ls conf/solaris-*.conf | tail -1) | grep VM_RELEASE | cut -d = -f 2)
31+
echo "please loging to ssh below, and run:"
32+
echo "============================="
33+
echo "bash build.sh conf/solaris-$latest.conf"
34+
echo "============================="
35+
touch /tmp/keepalive
36+
37+
- uses: neilpang/debugger-action@master
38+
39+
40+
41+
42+
43+
44+

.github/workflows/readme.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Update Readme"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- '.github/tpl/*'
9+
- '.github/data/*'
10+
- '.github/workflows/readme.yml'
11+
12+
release:
13+
types: [ published ]
14+
15+
16+
jobs:
17+
readme:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Get latest release
23+
id: get-latest-release
24+
uses: InsonusK/get-latest-release@v1.0.1
25+
with:
26+
myToken: ${{ github.token }}
27+
view_top: 1
28+
29+
- name: Using main branch
30+
run: |
31+
git switch main || (git fetch --all && git checkout -b main origin/main)
32+
echo "LATEST_MAJOR=$(echo ${{ steps.get-latest-release.outputs.tag_name }} | cut -d . -f 1)" >> $GITHUB_ENV
33+
echo "LATEST_TAG=${{ steps.get-latest-release.outputs.tag_name }}" >> $GITHUB_ENV
34+
latest=$(ls conf/*.conf | tail -1)
35+
echo "LATEST_CONF=$latest" >> $GITHUB_ENV
36+
37+
- name: Update the readme.md
38+
uses: vmactions/render@v0.0.1
39+
with:
40+
datafile: .github/data/datafile.ini
41+
files: |
42+
.github/tpl/README.tpl.md : README.md
43+
44+
- uses: EndBug/add-and-commit@v9
45+
with:
46+
message: "Update version to ${{ steps.get-latest-release.outputs.tag_name }}"
47+
pull: '--rebase --autostash '
48+
add: |
49+
README.md
50+

.github/workflows/syncbase.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Step 1, Sync generate.yml from Base Builder"
2+
on:
3+
schedule:
4+
- cron: '0 1 * * *'
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- 'main'
9+
paths:
10+
- '.github/data/*'
11+
- 'conf/*'
12+
- '.github/workflows/syncbase.yml'
13+
14+
15+
jobs:
16+
sync:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.VM_TOKEN }}
22+
23+
- name: Using main branch
24+
run: |
25+
git switch main || (git fetch --all && git checkout -b main origin/main)
26+
git clone https://github.com/anyvm-org/base-builder.git
27+
28+
- name: Sync generate.yml
29+
uses: anyvm-org/template-render@v0.0.2
30+
with:
31+
datafile: .github/data/datafile.ini
32+
files: |
33+
base-builder/.github/tpl/generate.tpl.yml : .github/workflows/generate.yml
34+
35+
- uses: EndBug/add-and-commit@v9
36+
with:
37+
message: "Sync from base-builder"
38+
pull: '--rebase --autostash '
39+
add: |
40+
.github/workflows/generate.yml
41+
42+

0 commit comments

Comments
 (0)