Skip to content

Commit 90ec4a3

Browse files
committed
chore(common): add ci and semantic release
1 parent 7bae5a3 commit 90ec4a3

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

.github/workflows/pipeline.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
unit-test:
11+
name: Unit Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Run unit tests
19+
run: make unit-test
20+
21+
smoke-test:
22+
name: Smoke Test
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.13"
33+
34+
- name: Run smoke tests
35+
run: make smoke-test
36+
37+
package-buildpack:
38+
name: Package Buildpack
39+
runs-on: ubuntu-latest
40+
needs:
41+
- unit-test
42+
- smoke-test
43+
44+
steps:
45+
- name: Check out repository
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Set up Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: "1.22"
54+
55+
- name: Install buildpack-packager
56+
run: go install github.com/cloudfoundry/libbuildpack/packager/buildpack-packager@latest
57+
58+
- name: Package buildpack
59+
run: buildpack-packager build -cached -any-stack
60+
61+
- name: Upload packaged buildpack
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: packaged-buildpack
66+
path: "*.zip"
67+
if-no-files-found: error
68+
69+
release-buildpack:
70+
name: Release Buildpack
71+
runs-on: ubuntu-latest
72+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
73+
needs:
74+
- package-buildpack
75+
permissions:
76+
contents: write
77+
issues: write
78+
pull-requests: write
79+
80+
steps:
81+
- name: Check out repository
82+
uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
85+
86+
- name: Download packaged buildpack
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: packaged-buildpack
90+
91+
- name: Set up Node.js
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: "22"
95+
96+
- name: Install semantic-release
97+
run: npm install --no-save semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github conventional-changelog-conventionalcommits
98+
99+
- name: Publish semantic release
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
run: npx semantic-release

.releaserc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"tagFormat": "v${version}",
6+
"plugins": [
7+
[
8+
"@semantic-release/commit-analyzer",
9+
{
10+
"preset": "conventionalcommits"
11+
}
12+
],
13+
[
14+
"@semantic-release/release-notes-generator",
15+
{
16+
"preset": "conventionalcommits"
17+
}
18+
],
19+
[
20+
"@semantic-release/github",
21+
{
22+
"assets": [
23+
{
24+
"path": "*.zip",
25+
"label": "Packaged buildpack"
26+
}
27+
]
28+
}
29+
]
30+
]
31+
}

manifest.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
language: python-uv
3+
4+
include_files:
5+
- bin/compile
6+
- bin/detect
7+
- bin/release
8+
- manifest.yml

0 commit comments

Comments
 (0)