Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: create site-version in build-meta #12

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/build-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ SCRIPT_DIR="$(dirname "$0")"
# Get Git short hash for repo at $SCRIPT_DIR
GIT_SHORT_HASH="$(git -C "$SCRIPT_DIR" rev-parse --short HEAD)"

# Get date of last Git commit for repo at $SCRIPT_DIR
GIT_COMMIT_DATE="$(git -C "$SCRIPT_DIR" log -1 --format=%cd --date=format:'%Y%m%d')"

# Build BROKEN by default. Disable for release builds.
BROKEN="1"

Expand Down Expand Up @@ -52,6 +55,10 @@ CONTAINER_VERSION="$(jq -r -e .container.version "$SCRIPT_DIR/build-info.json")"
DEFAULT_RELEASE_VERSION="$(make --no-print-directory -C "$SCRIPT_DIR/.." -f ci-build.mk version)"
DEFAULT_RELEASE_VERSION="$DEFAULT_RELEASE_VERSION-$GIT_SHORT_HASH"

# Create site-version from site.mk
SITE_VERSION="$(make --no-print-directory -C "$SCRIPT_DIR/.." -f ci-build.mk site-version)"
SITE_VERSION="$SITE_VERSION-ffda-$GIT_COMMIT_DATE-$GIT_SHORT_HASH"

# Enable Manifest generation conditionally
MANIFEST_STABLE="0"
MANIFEST_BETA="0"
Expand Down Expand Up @@ -151,6 +158,7 @@ echo "build-meta-output=$BUILD_META_TMP_DIR" >> "$BUILD_META_OUTPUT"
echo "container-version=$CONTAINER_VERSION" >> "$BUILD_META_OUTPUT"
echo "gluon-repository=$GLUON_REPOSITORY" >> "$BUILD_META_OUTPUT"
echo "gluon-commit=$GLUON_COMMIT" >> "$BUILD_META_OUTPUT"
echo "site-version=$SITE_VERSION" >> "$BUILD_META_OUTPUT"
echo "release-version=$RELEASE_VERSION" >> "$BUILD_META_OUTPUT"
echo "autoupdater-enabled=$AUTOUPDATER_ENABLED" >> "$BUILD_META_OUTPUT"
echo "autoupdater-branch=$AUTOUPDATER_BRANCH" >> "$BUILD_META_OUTPUT"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
${{ steps.build-metadata.outputs.container-version }}
release-version: >-
${{ steps.build-metadata.outputs.release-version }}
site-version: >-
${{ steps.build-metadata.outputs.site-version }}
autoupdater-enabled: >-
${{ steps.build-metadata.outputs.autoupdater-enabled }}
autoupdater-branch: >-
Expand Down Expand Up @@ -216,7 +218,8 @@ jobs:
make-target: update

- name: Build
uses: freifunk-gluon/action-build@v1
# yamllint disable-line rule:line-length
uses: freifunk-gluon/action-build@3a48a4d0db08ff393e08ec3074f1b218ee5ac54b
id: build-gluon
with:
container-version: ${{ needs.build-meta.outputs.container-version }}
Expand All @@ -229,6 +232,7 @@ jobs:
autoupdater-branch: |
${{ needs.build-meta.outputs.autoupdater-branch }}
release: ${{ needs.build-meta.outputs.release-version }}
site-version: ${{ needs.build-meta.outputs.site-version }}

- name: Pack and Upload build output
uses: ./.github/actions/build-artifact
Expand Down
3 changes: 3 additions & 0 deletions ci-build.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include site.mk

site-version:
@echo $(FFDA_SITE_VERSION)

version:
@echo $(DEFAULT_GLUON_RELEASE)
4 changes: 3 additions & 1 deletion site.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
DEFAULT_GLUON_RELEASE := 2.7~$(shell date '+%Y%m%d')
FFDA_SITE_VERSION := 2.7

DEFAULT_GLUON_RELEASE := $(FFDA_SITE_VERSION)~$(shell date '+%Y%m%d')
DEFAULT_GLUON_PRIORITY := 0

# Enable multidomain support
Expand Down