Skip to content

Commit df7e3ef

Browse files
committed
fix(): Adds a release job
1 parent 9644e82 commit df7e3ef

File tree

7 files changed

+73
-29
lines changed

7 files changed

+73
-29
lines changed

.github/workflows/release.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release a Module Version
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
create-a-new-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout project sources
13+
uses: actions/checkout@v4
14+
15+
- name: Compile the modules
16+
id: compile_the_modules
17+
run: |
18+
cd modules
19+
for d in */ ; do
20+
d=${d%%+(/)}
21+
version=$(jq -r '.version' $d/index.json)
22+
filename= ${d}-${version}.module
23+
zip -z $filename
24+
echo $filename >> release_notes.txt
25+
done
26+
- name: Create Release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ github.ref }}
33+
release_name: Release ${{ github.ref }}
34+
body_path: modules/release_notes.txt
35+
draft: false
36+
prerelease: false
37+
- name: upload artifacts
38+
id: upload_artifacts
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
for module in modules/*.module; do
43+
gh release upload ${{ github.ref }}
44+
done
45+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.module

modules/hello-world/index.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "hello-world-module",
3+
"description": "This is a hello world module to demonstrate",
4+
"maintainers": [
5+
{
6+
"name": "hello-world-maintainer"
7+
}
8+
],
9+
"version": "1.0.0",
10+
"requiredSystemVersions": [
11+
"hivemq-enterprise/4.34.0"
12+
],
13+
"resources": {
14+
"files": [
15+
{
16+
"type": "application/vnd+hivemq.data-policy+json",
17+
"path": "data-policy.json.vm",
18+
"name": "Data Policy to handle non-JSON messages"
19+
},
20+
{
21+
"type": "application/vnd+hivemq.schema+json",
22+
"path": "schema.json",
23+
"name": "Simple JSON schema"
24+
}
25+
]
26+
}
27+
}
File renamed without changes.
File renamed without changes.

my-custom-module/index.json

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

0 commit comments

Comments
 (0)