Skip to content

Commit d607b8c

Browse files
committed
feat: writing a short readme and adding semantic release action
1 parent 27822e1 commit d607b8c

4 files changed

Lines changed: 129 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
uses: ./.github/workflows/semantic-release.yml
11+
secrets:
12+
APP_ID: ${{ secrets.RELEASE_APP_ID }}
13+
APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_SECRET }}

.github/workflows/semantic-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ on:
5252

5353
jobs:
5454
prepare:
55-
# runs-on: arc-runner-set
56-
runs-on: ubuntu-latest
55+
runs-on: [self-hosted]
5756
permissions:
5857
contents: write
5958
packages: write

.releaserc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"tagFormat": "v${version}",
33
"branches": [
4-
"main",
5-
{ "name": "develop", "prerelease": "develop" },
6-
{ "name": "release/*", "prerelease": "rc" }
4+
"main"
75
],
86
"plugins": [
97
"@semantic-release/commit-analyzer",
@@ -31,4 +29,4 @@
3129
}
3230
]
3331
]
34-
}
32+
}

README.md

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,113 @@
1-
# github-actions
1+
# mogenius/github-actions
2+
3+
Reusable GitHub Actions workflows for the mogenius platform.
4+
5+
Always pin calls to a full commit SHA to guarantee reproducibility:
6+
7+
```yaml
8+
uses: mogenius/github-actions/.github/workflows/<workflow>.yml@<sha> # main
9+
```
10+
11+
---
12+
13+
## Workflows
14+
15+
### `semantic-release.yml` — Prepare Version
16+
17+
Runs [semantic-release](https://semantic-release.gitbook.io/) to determine the next version and outputs build metadata for downstream jobs. Supports GitHub App auth or a PAT.
18+
19+
#### Secrets
20+
21+
| Name | Description |
22+
|------|-------------|
23+
| `APP_ID` | GitHub App client ID (use with `APP_PRIVATE_KEY`) |
24+
| `APP_PRIVATE_KEY` | GitHub App private key |
25+
| `RELEASE_TOKEN` | PAT alternative to App auth |
26+
27+
Either `RELEASE_TOKEN` or both App secrets must be set.
28+
29+
#### Inputs
30+
31+
| Name | Default | Description |
32+
|------|---------|-------------|
33+
| `version_override` | `''` | Pin an explicit version, bypassing semantic-release |
34+
| `default_version` | `'dev'` | Fallback version when no release is created |
35+
| `dry_run` | `false` | Run semantic-release without creating a tag or release |
36+
| `ref` | `''` | Git ref to checkout (defaults to the triggering ref) |
37+
38+
#### Outputs
39+
40+
| Name | Description |
41+
|------|-------------|
42+
| `version` | Resolved version (`version_override` > semver > `default_version`) |
43+
| `semver` | Semver string without `v` prefix; empty if no release was created |
44+
| `is_release` | `'true'` when semantic-release published a new release |
45+
| `commit_hash` | Short commit hash |
46+
| `git_branch` | Branch name |
47+
| `build_timestamp` | ISO 8601 build timestamp |
48+
49+
#### Example
50+
51+
```yaml
52+
prepare:
53+
uses: mogenius/github-actions/.github/workflows/semantic-release.yml@<sha> # main
54+
secrets:
55+
APP_ID: ${{ secrets.RELEASE_APP_ID }}
56+
APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_SECRET }}
57+
with:
58+
default_version: 'dev'
59+
```
60+
61+
---
62+
63+
### `build-multiarch.yml` — Build Multi-Arch Container
64+
65+
Builds a Docker image natively on amd64 and arm64 runners, cross-compiles armv7 on amd64 via QEMU, then assembles a combined multi-arch manifest.
66+
67+
`COMMIT_HASH`, `GIT_BRANCH`, `BUILD_TIMESTAMP`, and `VERSION` are always injected as build args. Use `build_args` for args shared across all architectures and the per-arch variants for anything that differs (e.g. arch-specific base images).
68+
69+
#### Inputs
70+
71+
| Name | Required | Default | Description |
72+
|------|----------|---------|-------------|
73+
| `version` | yes | — | Image version tag |
74+
| `image` | yes | — | Full image path without tag (e.g. `ghcr.io/myorg/myimage`) |
75+
| `registry` | no | `ghcr.io` | Container registry hostname for `docker login` |
76+
| `dockerfile` | no | `./Dockerfile` | Path to Dockerfile |
77+
| `context` | no | `.` | Docker build context path |
78+
| `architectures` | no | `amd64,arm64,armv7` | Comma-separated architectures to build |
79+
| `build_args` | no | `''` | Build args injected into every arch build |
80+
| `build_args_amd64` | no | `''` | Extra build args for the amd64 job only |
81+
| `build_args_arm64` | no | `''` | Extra build args for the arm64 job only |
82+
| `build_args_armv7` | no | `''` | Extra build args for the armv7 job only |
83+
| `push_latest` | no | `true` | Push a `:latest` tag alongside the version tag |
84+
| `runner_amd64` | no | `arc-runner-set-amd64` | Runner label for amd64 native builds |
85+
| `runner_arm64` | no | `arc-runner-set-arm64` | Runner label for arm64 native builds |
86+
87+
#### Outputs
88+
89+
| Name | Description |
90+
|------|-------------|
91+
| `digest_amd64` | Image digest for amd64 |
92+
| `digest_arm64` | Image digest for arm64 |
93+
| `digest_armv7` | Image digest for armv7 |
94+
95+
#### Example
96+
97+
```yaml
98+
build:
99+
needs: [prepare]
100+
uses: mogenius/github-actions/.github/workflows/build-multiarch.yml@<sha> # main
101+
secrets: inherit
102+
with:
103+
version: ${{ needs.prepare.outputs.version }}
104+
image: ghcr.io/myorg/myimage
105+
build_args: |
106+
DEV_BUILD=yes
107+
build_args_amd64: |
108+
BASE_IMAGE=ghcr.io/myorg/base:latest-amd64
109+
build_args_arm64: |
110+
BASE_IMAGE=ghcr.io/myorg/base:latest-arm64
111+
build_args_armv7: |
112+
BASE_IMAGE=ghcr.io/myorg/base:latest-armv7
113+
```

0 commit comments

Comments
 (0)