@@ -19,6 +19,7 @@ permissions:
1919
2020jobs :
2121 build-and-push-image :
22+ name : docker buildx pkgxdev/pkgx:${{ github.event.release.tag_name || github.event.inputs.tag }}
2223 runs-on : ubuntu-latest
2324 steps :
2425 - uses : robinraju/release-downloader@v1.11
2728 tag : ${{ github.event.inputs.tag }}
2829 fileName : pkgx-*.tar.xz
2930
31+ - name : is_latest?
32+ id : latest
33+ run : |
34+ TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.tag }}"
35+ LATEST_RELEASE=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name')
36+ if [ "$TAG_NAME" == "$LATEST_RELEASE" ]; then
37+ echo "value=true" >> "${GITHUB_OUTPUT}"
38+ else
39+ echo "value=false" >> "${GITHUB_OUTPUT}"
40+ fi
41+ env :
42+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43+
3044 - name : Unpack Binaries
3145 run : |
3246 for filename in pkgx-*+*+*.tar.xz; do
4761 with :
4862 path : src
4963
50- - name : log in to github pkgs
51- uses : docker/login-action@v3
52- with :
53- registry : ghcr.io
54- username : ${{ github.actor }}
55- password : ${{ github.token }}
56-
5764 - name : log in to docker hub
5865 uses : docker/login-action@v3
5966 with :
@@ -63,16 +70,14 @@ jobs:
6370 - uses : docker/metadata-action@v5
6471 id : meta
6572 with :
66- images :
67- ghcr.io/${{ github.repository }}
68- pkgxdev/pkgx
73+ images : pkgxdev/pkgx
74+ flavor : |
75+ latest=${{ steps.latest.outputs.value }}
6976 tags : |
7077 type=sha
71- type=ref,event=branch
72- type=semver,pattern=v{{version}}
73- type=semver,pattern=v{{major}}.{{minor}}
74- type=semver,pattern=v{{major}}
75- type=raw,value=latest
78+ type=semver,pattern=v{{version}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
79+ type=semver,pattern=v{{major}}.{{minor}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
80+ type=semver,pattern=v{{major}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
7681
7782 - uses : docker/setup-qemu-action@v3
7883 - uses : docker/setup-buildx-action@v3
8792 $tags \
8893 --platform linux/amd64,linux/arm64 \
8994 --file ./src/.github/Dockerfile \
90- .
95+ .
0 commit comments