Skip to content

Commit

Permalink
distinguish release and ci version
Browse files Browse the repository at this point in the history
- use debian version consistently
- if the commit is not on a git tag, append ci version
  • Loading branch information
neolynx committed Sep 19, 2024
1 parent bba38f0 commit 2c9823c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
run: |
./upload-artifacts.sh release ${{ matrix.suite }}
ci-release-build:
ci-binary-build:
name: "CI Build (Binary)"
needs: test
runs-on: ubuntu-latest
Expand All @@ -212,8 +212,7 @@ jobs:

- name: "Get aptly version"
run: |
# Because dpkg-parsechangelog is not installed, will return the latest git tag
echo "VERSION=$(make version RELEASE=yes)" >> $GITHUB_OUTPUT
echo "VERSION=$(make version)" >> $GITHUB_OUTPUT
id: releaseversion

- name: "Setup Go"
Expand All @@ -237,7 +236,7 @@ jobs:
name: "Github Release: ${{ github.ref_name }}"
runs-on: ubuntu-latest
continue-on-error: false
needs: ci-release-build
needs: ci-binary-build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Artifacts
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ man: ## Create man pages
make -C man

version: ## Print aptly version
@ts=`TZ=UTC git show -s --format='%cd.%h' --date=format-local:'%Y%m%d%H%M%S'`; \
@ci="" ; \
if [ -z "`git tag --points-at HEAD`" ]; then \
ci=`TZ=UTC git show -s --format='+%cd.%h' --date=format-local:'%Y%m%d%H%M%S'`; \
fi ; \
if which dpkg-parsechangelog > /dev/null 2>&1; then \
if [ -z "$$ts" ]; then \
dpkg-parsechangelog -S Version; \
else \
echo `dpkg-parsechangelog -S Version`+$$ts; \
fi \
echo `dpkg-parsechangelog -S Version`$$ci; \
else \
git describe --tags --always | sed 's@^v@@' | sed 's@-@+@g'; \
echo `grep ^aptly -m1 debian/changelog | sed 's/.*(\([^)]\+\)).*/\1/'`$$ci ; \
fi

build: ## Build aptly
Expand Down

0 comments on commit 2c9823c

Please sign in to comment.