Skip to content

Commit 51f1d10

Browse files
Merge pull request #17 from RustLangES/feat/11-cd
DRAFT: Prep for CD (Publish ISO and stuff)
2 parents d839a59 + 29a7501 commit 51f1d10

File tree

5 files changed

+127
-23
lines changed

5 files changed

+127
-23
lines changed

.github/workflows/ci-cd.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI/CD
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
- dev
11+
paths:
12+
- "src/**/**.rs"
13+
- "crates/**/**.rs"
14+
- "kernel/*.rs"
15+
16+
jobs:
17+
quality-gate:
18+
permissions:
19+
contents: read
20+
21+
uses: RustLangES/.github/.github/workflows/quality-gate.yml@main
22+
with:
23+
runs-on: ubuntu-latest
24+
checks-command: "--all --check"
25+
clippy-command: "-- -D warnings"
26+
tests-command: "test"
27+
28+
build:
29+
permissions:
30+
contents: read
31+
32+
needs: quality-gate
33+
name: Build
34+
runs-on: ubuntu-latest
35+
steps:
36+
37+
- uses: actions/checkout@v4
38+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
39+
with:
40+
toolchain: stable
41+
42+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
43+
with:
44+
command: build
45+
args: "--release --all-features"

.github/workflows/quality-gate.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release Build and Publish
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
workflow_dispatch:
11+
inputs:
12+
release_name:
13+
description: "Name of release"
14+
required: false
15+
default: ""
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Build release
26+
run: cargo build --release
27+
28+
- name: Convert BIOS image to ISO
29+
run: |
30+
mkdir -p isos
31+
cp target/bios.img isos/bios.img
32+
xorriso -as mkisofs -o isos/bios.iso isos/bios.img
33+
34+
- name: Convert UEFI image to ISO
35+
run: |
36+
cp target/uefi.img isos/uefi.img
37+
xorriso -as mkisofs -o isos/uefi.iso isos/uefi.img
38+
39+
- name: Get tag or manual release name
40+
id: tag_name
41+
run: |
42+
if [ -n "${{ github.event.inputs.release_name }}" ]; then
43+
echo "RELEASE_NAME=${{ github.event.inputs.release_name }}" >> $GITHUB_ENV
44+
else
45+
echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
46+
fi
47+
48+
- name: Get commit history with mentions
49+
id: commit_history
50+
run: |
51+
if [ -n "${{ github.event.inputs.release_name }}" ]; then
52+
# Si es un lanzamiento manual, muestra los últimos 10 commits
53+
echo "COMMIT_HISTORY=$(git log --pretty=format:'- %s (by @%an)' -n 10)" >> $GITHUB_ENV
54+
else
55+
# Si es un lanzamiento automático, muestra los commits desde el último tag
56+
echo "COMMIT_HISTORY=$(git log --pretty=format:'- %s (by @%an)' $(git describe --tags --abbrev=0)..HEAD)" >> $GITHUB_ENV
57+
fi
58+
59+
- name: Create Release
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
tag_name: ${{ env.RELEASE_NAME }}
63+
name: ${{ env.RELEASE_NAME }}
64+
body: ${{ env.COMMIT_HISTORY }}
65+
files: |
66+
isos/bios.iso
67+
isos/uefi.iso

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
all: build lint fmt test run
2+
13
build:
24
cargo build
35

@@ -11,4 +13,7 @@ fmt-fix:
1113
cargo fmt
1214

1315
test:
14-
cargo test
16+
cargo test
17+
18+
run:
19+
cargo run

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@
66

77
Memsos is a tool written in rust with the objective to check your memory in a fast way, memsos works for both uefi and bios.
88

9+
## Requirements
10+
11+
If using arch you need to install `qemu-system-x86`
12+
13+
## Generate Images
14+
15+
To generate the images we only need to run `cargo build`, they are created in `target/`.
16+
Then we can try it with `cargo run`
17+
918
### In dev

0 commit comments

Comments
 (0)