Skip to content

Commit 2a7b5b1

Browse files
committed
add build job for branches
1 parent 042b2db commit 2a7b5b1

5 files changed

+39
-26
lines changed

.github/workflows/build-packages.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build MeshChat Packages
2+
on: push
3+
4+
jobs:
5+
calculate-version:
6+
runs-on: ubuntu-latest
7+
outputs:
8+
build_version: ${{ steps.build-version-slug.outputs.build_version }}
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- id: build-version-slug
14+
run: |
15+
date=$(date +%Y%m%d)
16+
branch="${GITHUB_REF_NAME}"
17+
commit=$(git rev-parse --short HEAD)
18+
version="${date}-${branch}-${commit}"
19+
20+
echo "build_version=$version" >> $GITHUB_OUTPUT
21+
22+
build-meshchat-package:
23+
needs: calculate-version
24+
uses:
25+
./.github/workflows/workflow-meshchat-package.yaml
26+
with:
27+
build_version: ${{ needs.calculate-version.outputs.build_version }}
28+
build_dir: package/meshchat-ipkg
29+
30+
build-meshchat-api-package:
31+
needs: calculate-version
32+
uses:
33+
./.github/workflows/workflow-meshchat-api-package.yaml
34+
with:
35+
build_version: ${{ needs.calculate-version.outputs.build_version }}
36+
build_dir: package/meshchat-ipkg

.github/workflows/release-meshchat.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
build-meshchat-package:
3131
needs: create-release
3232
uses:
33-
./.github/workflows/build-meshchat-package.yaml
33+
./.github/workflows/workflow-meshchat-package.yaml
3434
with:
3535
ref: release
3636
build_version: ${{ needs.create-release.outputs.build_version }}
@@ -39,7 +39,7 @@ jobs:
3939
build-meshchat-api-package:
4040
needs: create-release
4141
uses:
42-
./.github/workflows/build-meshchat-api-package.yaml
42+
./.github/workflows/workflow-meshchat-api-package.yaml
4343
with:
4444
build_version: ${{ needs.create-release.outputs.build_version }}
4545
build_dir: package/meshchat-ipkg

.github/workflows/build-meshchat-package.yaml .github/workflows/workflow-meshchat-package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
ref:
1212
required: false
1313
type: string
14-
default: $GITHUB_REF_NAME
14+
default: ${{ github.ref_name }}
1515

1616
jobs:
1717
create-meshchat-package:

package/update-version.sh

-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
#!/bin/bash
32

43
# This script runs from the top of the project directory and
@@ -45,25 +44,3 @@ sed -i "s/^Version:.*/Version: $version/" $IPK_DIR/CONTROL/control
4544
if [[ -f $IPK_DIR/www/cgi-bin/meshchatconfig.lua ]]; then
4645
sed -i "s/^app_version.*$/app_version = \"${version}\"/" $IPK_DIR/www/cgi-bin/meshchatconfig.lua
4746
fi
48-
||||||| parent of 36f653c (Added beginnings of package building code)
49-
=======
50-
#!/bin/bash
51-
52-
# This script runs from the top of the project directory and
53-
# updates the version number in the control file for the package
54-
# being built.
55-
56-
IPK_DIR=$1
57-
58-
if [ "$GITHUB_REF_TYPE" == 'tag' ]; then
59-
# ideally should only get version tags
60-
if [ ${GITHUB_REF_NAME} : "v[0-9]" ]; then
61-
version="${GITHUB_REF_NAME#v}"
62-
fi
63-
else
64-
# branch gets date code
65-
version=$(date +%Y%m%d)
66-
fi
67-
68-
sed -i "s/^Version:.*/Version: $version/" $IPK_DIR/CONTROL/control
69-
>>>>>>> 36f653c (Added beginnings of package building code)

0 commit comments

Comments
 (0)