2727 tag : ${{ github.event.inputs.tag }}
2828 fileName : pkgx-*.tar.xz
2929
30+ - name : determine if we are latest
31+ id : tags
32+ run : |
33+ TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.tag }}"
34+ LATEST_RELEASE=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name')
35+ if [ "$TAG_NAME" == "$LATEST_RELEASE" ]; then
36+ TAGS="$TAGS type=raw,value=latest"
37+ fi
38+ echo "value=$TAGS" >> $GITHUB_OUTPUT
39+ env :
40+ TAGS : >
41+ type=sha
42+ type=semver,pattern=v{{version}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
43+ type=semver,pattern=v{{major}}.{{minor}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
44+ type=semver,pattern=v{{major}},value=${{ github.event.release.tag_name || github.event.inputs.tag }}
45+
3046 - name : Unpack Binaries
3147 run : |
3248 for filename in pkgx-*+*+*.tar.xz; do
4763 with :
4864 path : src
4965
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-
5766 - name : log in to docker hub
5867 uses : docker/login-action@v3
5968 with :
6372 - uses : docker/metadata-action@v5
6473 id : meta
6574 with :
66- images :
67- ghcr.io/${{ github.repository }}
68- pkgxdev/pkgx
69- tags : |
70- 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
75+ images : pkgxdev/pkgx
76+ tags : ${{ steps.tags.outputs.value }}
7677
7778 - uses : docker/setup-qemu-action@v3
7879 - uses : docker/setup-buildx-action@v3
8788 $tags \
8889 --platform linux/amd64,linux/arm64 \
8990 --file ./src/.github/Dockerfile \
90- .
91+ .
0 commit comments